Hi
I try it but it can't work also.I am using Tomcat4.1.18.My web app's context path is "/myweb".
After I change it to href="myweb/jsp/viewtopic.do?id=<bean:write ... ...", I move the mouse to the hyperlink,then the statusbar display "http://localhost:3030/myweb/jsp/myweb/jsp/viewtopic.do?id=4". When I click it Tomcat remain report the last error:
HTTP Status 400 - Invalid path /jsp/myweb/jsp/viewtopic was requested
--------------------------------------------------------------------------------
type Status report
message Invalid path /jsp/myweb/jsp/viewtopic was requested
description The request sent by the client was syntactically incorrect (Invalid path /jsp/myweb/jsp/viewtopic was requested).
////////////////////////////////////////////////////////////////////
I am also change to href="/myweb/jsp/viewtopic.do?id=<bean... ..."
Statusbar display :"http://localhost:3030/myweb/jsp/viewtopic.do?id=4"
But it can't work too.error is:
///////////////////////////////////////////////////////////
HTTP Status 400 - Invalid path /viewtopic was requested
--------------------------------------------------------------------------------
type Status report
message Invalid path /viewtopic was requested
description The request sent by the client was syntactically incorrect (Invalid path /viewtopic was requested).In Tomcat console:
///////////////////////////////////////////////////////////////////////
2003-10-7 19:08:18 org.apache.struts.action.RequestProcessor processMapping
server: Invalid path /viewtopic was requested
:roll:
So I think the html tag href can't be used with the struts TAG.Now I am thinking that I will use the "<html:link action paramId .. paramName ..>" Tag.
The problem now is after I change the code to
<html:link action="/viewtopic.do" paramName="lovebean" paramProperty="id" paramId="id"><bean:write name="love" property="title"/></html:link>
I add the article data to arraylist ,later add the arraylist to request.setAttribute("lovetable",listdata);
jsp code is:
////////////////////////////////////////////////////
<logic:iterate id="love" name="lovetable">
<td><bean:write name="love" property="id"/></td>
<td><html:link action="viewtopic.do" paramName="lovetable" paramProperty="id" paramId=""><bean:write name="love" property="title"/></html:link></td>
<td><bean:write name="love" property="name"/></td>
<td><bean:write name="love" property="time"/></td>
</tr>
</logic:iterate>
Report error is:
org.apache.jasper.JasperException: No getter method for property id of bean lovetable
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
////////////////////////////////////////////////////////
The lovetable is list and it don't have getter or setter indeed.whether I take a mistake while using the tag <html:link action=...>?HOw to use it?