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

» JWorld@TW » Web Framework » Struts  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 網頁無法執行.do的動作,請問那裡設錯?
Hanpeng





發文: 15
積分: 0
於 2005-02-15 23:20 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
執行環境tomcat

TestAction1.jsp
<FORM action="<%=request.getContextPath()%>/action/TA.do" method="post">
<INPUT type="text" name="t1"size="20"><BR>
<INPUT type="submit" name="s1">
</FORM>

錯誤訊息如下:
HTTP Status 400 - Invalid path /action/TA was requested
--------------------------------------------------------------------------------
type Status report
message Invalid path /action/TA was requested
description The request sent by the client was syntactically incorrect (Invalid path /action/TA was requested).

附件:XML.txt(含web.xml和struts-config.xml)

xml.txt (2.56k)


reply to postreply to post
作者 Re:網頁無法執行.do的動作,請問那裡設錯? [Re:Hanpeng]
thewho





發文: 14
積分: 0
於 2005-02-16 09:08 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
沒有"/action"這個目錄,換成
1
<FORM action="<%=request.getContextPath()%>/TA.do" method="post">

試試


thewho edited on 2005-02-16 09:13
reply to postreply to post
作者 Re:網頁無法執行.do的動作,請問那裡設錯? [Re:Hanpeng]
randycch





發文: 47
積分: 3
於 2005-02-16 23:34 user profilesend a private message to usersend email to randycchreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
依據你的 struts-config.xml 設定 , 這樣寫應該就可以了 :
1
<FORM action="/TA.do" method="post">


reply to postreply to post
作者 Re:網頁無法執行.do的動作,請問那裡設錯? [Re:Hanpeng]
Hanpeng





發文: 15
積分: 0
於 2005-02-17 01: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
各位大大,我已經將程式改為如下

<FORM action="<%=request.getContextPath()%>/TA.do" method="post">
但仍出現

HTTP Status 400 - Invalid path /TA was requested
type Status report
message Invalid path /TA was requested
description The request sent by the client was syntactically incorrect (Invalid path /TA was requested).
--------------------------------------------------------------------------------
Apache Tomcat/5.0.28

的錯誤訊息。
其中在stdout.txt檔中出現了

2005/2/17 上午 01:14:49 java.util.jar.Attributes read
警告: Duplicate name in Manifest: Class-Path
2005/2/17 上午 01:14:53 org.apache.struts.action.RequestProcessor processMapping
嚴重的: Invalid path /TA was requested

在xml都沒有修改的情況下,請問我的程式錯在那裡?....謝謝你的幫忙...


reply to postreply to post
作者 Re:網頁無法執行.do的動作,請問那裡設錯? [Re:Hanpeng]
Jill_Yeh

眾裡尋他千百度



發文: 89
積分: 0
於 2005-02-17 08:51 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
Hanpeng wrote:
各位大大,我已經將程式改為如下

<FORM action="<%=request.getContextPath()%>/TA.do" method="post">
但仍出現

HTTP Status 400 - Invalid path /TA was requested
type Status report
message Invalid path /TA was requested
description The request sent by the client was syntactically incorrect (Invalid path /TA was requested).
--------------------------------------------------------------------------------
Apache Tomcat/5.0.28

的錯誤訊息。
其中在stdout.txt檔中出現了

2005/2/17 上午 01:14:49 java.util.jar.Attributes read
警告: Duplicate name in Manifest: Class-Path
2005/2/17 上午 01:14:53 org.apache.struts.action.RequestProcessor processMapping
嚴重的: Invalid path /TA was requested

在xml都沒有修改的情況下,請問我的程式錯在那裡?....謝謝你的幫忙...


既然都用 struts 了, 順便用他的 taglib 吧
1
<FORM action="<html:rewrite page='/TA.do' />" method="post">


另外, 最後的訊息怪怪的, Duplicate name in Manifest?
你是 Deploy WAR 嗎? 裡面應該有個 META-INF/MANIFEST.MF 檔案
是不是裡面有特別制定參數, 感覺好像衝到了??
跟環境變數比較一下吧..


reply to postreply to post
作者 Re:網頁無法執行.do的動作,請問那裡設錯? [Re:Hanpeng]
arc365





發文: 3
積分: 0
於 2005-03-29 13:07 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
<FORM action="/TA.do" method="post">
这样子写就行了。


reply to postreply to post
作者 Re:網頁無法執行.do的動作,請問那裡設錯? [Re:arc365]
metavige

metavige

版主

發文: 2133
積分: 10
於 2005-03-29 13:20 user profilesend a private message to usersend email to metavigereply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
如果你要在 action 內設定使用 /TA.do
哪你的 web.xml 內最好是把 url-mapping 設定成 /*.do

若是 *.do
如果你目前的 URL 是在 /action 目錄下
則應為 /action/TA.do


reply to postreply to post
請各位新手參考 論壇規範Java 新手 FAQ
作者 Re:網頁無法執行.do的動作,請問那裡設錯? [Re:Hanpeng]
hkdennis2k





發文: 1926
積分: 6
於 2005-03-30 12:01 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
是 struts-config.xml 出錯

不是
<action path="/TA.do".....

而是
<action path="/TA".....

否則你就要在 html 中寫為 TA.do.do 了......


reply to postreply to post
» JWorld@TW »  Web Framework » Struts

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