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

» JWorld@TW » Java 新手區 » 例外/錯誤處理  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
作者 action 路徑出錯
ktidings





發文: 7
積分: 0
於 2010-04-14 17:21 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 路徑出錯,試了又改也找不出哪錯了
Console-com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: Could not find action or result
There is no Action mapped for namespace / and action name Search. - [unknown location]
麻煩請各位幫忙看一下,謝謝

ser.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<%@ page language="java" contentType="text/html; charset=BIG5"
  pageEncoding="BIG5"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<title>查詢</title>
</head>
<body>
<s:form action="bean" namespace="/bean">
  <s:textfield label="輸入查詢" name="sertxt"></s:textfield>
  <s:submit label="查詢" name="search" value="查詢"></s:submit>
</s:form>
</body>
</html>
 


struts.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
     "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
  <constant name="struts.i18n.encoding" value="Big5"></constant>
  <package name="test_struts2" namespace="/bean" extends="struts-default">
    <action name="bean" class="bean.allbean">
      <result>/display.jsp</result>
      <result name="error">/error.jsp</result>
    </action>
  </package>
</struts  >
 


display

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<%@ page language="java" contentType="text/html; charset=BIG5"
    pageEncoding="BIG5"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
<html>
<head>
 
</head>
<style>
.dataO {border:0px solid blue;border-collapse:collapse;}
.dataO th{ background-color:#ddd;color:#666;text-align:left;border:1px solid white;padding:5px;}
.dataO td{padding:5px;}
.dataO tr.odd {background-color:#fafbff;}
.dataO tr.even {background-color:#f4f4ff;}
</style>
<body>
 
<table class="dataO">
  <tr>
    <th>1</th>
    <th>2</th>
    <th>3</th>
    <th>4</th>
    <th>5</th>
  </tr>
<%-- --%>  
<s:iterator value="fields" id="field" status="dataO_stat">
    <tr class="<s:if bean="#dataO_stat.odd == true">odd</s:if><s:else>even</s:else>">
      <td><s:property value="ID" /></td>
      <td><s:property value="NAME" /></td>
      <td><s:property value="TYPE" /></td>
      <td><s:property value="AUTHYN" /></td>
      <td><s:property value="DESCS" /></td>
    </tr>
  </s:iterator>
  
</table>
 
</body>
</html>
 


路徑

action.bmp (306.78k)


ktidings edited on 2010-04-14 18:03
reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
1356 action 路徑出錯 ktidings 2535 2010-04-14 17:21
1180 Re:action 路徑出錯 koji 37 2010-04-14 22:06
1130 Re:action 路徑出錯 ktidings 8 2010-04-16 09:55
1274 Re:action 路徑出錯 ktidings 20 2010-04-16 17:51
» JWorld@TW »  Java 新手區 » 例外/錯誤處理

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

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8