JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java 新手區  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
作者 servlet HTTP Status 500 如何解決
as0955344054





發文: 107
積分: 0
於 2013-10-23 20:33 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我想請問一下以下圖片錯誤的問題?? 怎麼修正
<servlet>
<servlet-name>testhttp</servlet-name>>
<servlet-class>bio.operon.servlet.testhttp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testhttp</servlet-name>
<url-pattern>/testhttp.do</url-pattern>
</servlet-mapping>

這是我的XML設定

http://www.javaworld.com.tw/jute/gallery/Y/X/YXMwOTU1MzQ0MDU0/1382530923987.png

testhttp檔案路徑在
E:\Apache Software Foundation\Tomcat 8.0\webapps\PPO\WEB-INF\classes\bio\operon\servlet\testhttp.class

public class testhttp extends HttpServlet{
public testhttp() {
}

protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String url ="/PPO/related_tool.jsp";
ServletContext sc = getServletContext();
HttpSession session = req.getSession();
int testint = 100;
session.setAttribute("testint", testint);
RequestDispatcher rd = sc.getRequestDispatcher(url);
rd.forward(req, resp);
}

protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {

doPost(req,resp);
}

}

另外附上JAVA程式碼


as0955344054 edited on 2013-10-23 23:26
reply to postreply to post
作者 Re:servlet HTTP Status 500 如何解決 [Re:as0955344054]
chuanchu





發文: 120
積分: 0
於 2013-10-23 21:19 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
as0955344054 wrote:
我想請問一下以下圖片錯誤的問題?? 怎麼修正
<servlet>
<servlet-name>testhttp</servlet-name>>
<servlet-class>bio.operon.servlet.testhttp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testhttp</servlet-name>
<url-pattern>/testhttp.do</url-pattern>
</servlet-mapping>

這是我的XML設定

http://www.javaworld.com.tw/jute/gallery/Y/X/YXMwOTU1MzQ0MDU0/1382530923987.png

testhttp檔案路徑在
E:\Apache Software Foundation\Tomcat 8.0\webapps\PPO\WEB-INF\classes\bio\operon\testhttp.class

public class testhttp extends HttpServlet{
public testhttp() {
}

protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String url ="/PPO/related_tool.jsp";
ServletContext sc = getServletContext();
HttpSession session = req.getSession();
int testint = 100;
session.setAttribute("testint", testint);
RequestDispatcher rd = sc.getRequestDispatcher(url);
rd.forward(req, resp);
}

protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {

doPost(req,resp);
}

}

另外附上JAVA程式碼


<servlet-class>bio.operon.servlet.testhttp</servlet-class>

testhttp檔案路徑在
E:\Apache Software Foundation\Tomcat 8.0\webapps\PPO\WEB-INF\classes\bio\operon\testhttp.class

如紅色所示
用code標記程式當個有水準的新手


reply to postreply to post
作者 Re:servlet HTTP Status 500 如何解決 [Re:chuanchu]
as0955344054





發文: 107
積分: 0
於 2013-10-23 22:41 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
sor我想你誤會了
.class我只是想標示是CLASS黨 真正黨名一樣是 testhttp


reply to postreply to post
作者 Re:servlet HTTP Status 500 如何解決 [Re:as0955344054]
chuanchu





發文: 120
積分: 0
於 2013-10-23 22:44 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
是套件目錄有問題

reply to postreply to post
作者 Re:servlet HTTP Status 500 如何解決 [Re:chuanchu]
as0955344054





發文: 107
積分: 0
於 2013-10-23 23:37 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
抱歉我看到你要跟我說的了

SORRY 不過那不是主要問題

那只是我貼上時不小心的失誤

但是實際上我的程式跟路徑是對的 是貼上來提問 複製沒複製到


reply to postreply to post
作者 Re:servlet HTTP Status 500 如何解決 [Re:as0955344054]
fsz570





發文: 19
積分: 0
於 2013-10-24 09:33 user profilesend a private message to usersend email to fsz570reply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
開發過程中 package name 有改過嗎?
有的話參考底下這個連結的說明
http://stackoverflow.com/questions/4621572/cant-run-my-servlet-from-tomcat-server-even-though-the-classes-are-in-package/4621609#4621609


reply to postreply to post

David Wu(吳清霖)
E-mail: fsz570@gmail.com

世事短如春夢,人情薄似秋雲。 不須計較苦勞心。萬事原來有命。
幸遇三杯酒好,況逢一朵花新。 片時歡笑且相親。明日陰晴未定。
作者 Re:servlet HTTP Status 500 如何解決 [Re:fsz570]
as0955344054





發文: 107
積分: 0
於 2013-10-24 13:05 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
感謝 問題已解決

reply to postreply to post
» JWorld@TW »  Java 新手區

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8