hi all, my struts config file has and my index.jsp has when i click on html:link i get the following exception, Cannot create rewrite URL: java.net.MalformedURLException: Cannot retrieve ActionForward named search org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:479) org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:334) org.apache.jsp.index_jsp._jspx_meth_html_link_0(index_jsp.java:97) org.apache.jsp.index_jsp._jspService(index_jsp.java:72) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) thanks, Shabarish
I'm worried about those double quotes , remove them ! And hope you are not using any module relative URI, because this is what Struts Docs says about html:link forward
The base URL for this hyperlink is calculated based on which of the following attributes you specify (you must specify exactly one of them):
* forward - Use the value of this attribute as the name of a global ActionForward to be looked up, and use the module-relative or context-relative URI found there. If the forward is module-relative then it must point to an action and NOT to a page.
Originally posted by shabarish vai: does html:link look only into global-forwardings? what in case if i want container to look into action mapping.
Yes, It looks into Global ActionForwards and Local forwards can be nested within an <action> element and only available to an Action object when it is invoked through that ActionMapping.
and you post .
..when i click on html:link i get the following exception, Cannot create rewrite URL: java.net.MalformedURLException: Cannot retrieve ActionForward named search org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:479)..
I dont think this exception comes when you click on <html:link tag , This error comes when you load index.jsp, Am I correct ?
shabarish vai
Ranch Hand
Joined: May 26, 2008
Posts: 79
posted
0
hi Sagar Rohankar, am able to laod index.jsp and when i click on the link sometime i get he above mentioned exception , and when i changed the html form tag to struts form tag i get where ever i use struts tags say html,form etc i get exception thanks, Shabarish
shabarish vai
Ranch Hand
Joined: May 26, 2008
Posts: 79
posted
0
my search.jsp is
i get
shabarish vai
Ranch Hand
Joined: May 26, 2008
Posts: 79
posted
0
if i use the search.jsp by removing struts tag to html tag like
am able to load search.jsp i want to use struts tag anybody please help me Thanks, Shabarish
Originally posted by shabarish vai: my search.jsp is
i get
You need to put action attribute in html:form tag and the post the server logs entry, which give better view of that particular exception !!
shabarish vai
Ranch Hand
Joined: May 26, 2008
Posts: 79
posted
0
i actually made changes in html tld file ie inside attribute tag i changed the tag <required>true</required> to <required>false</required> so that attribute in form tag(struts tag) is not mandatory and i can provide submit button and there i can foward it to different/same jsp. when i use html tag am able to load search.jsp but its not same with struts tag.
Originally posted by shabarish vai: i actually made changes in html tld file ie inside attribute tag i changed the tag <required>true</required> to <required>false</required> so that attribute in form tag(struts tag) is not mandatory
No NO, You cant do that ! Its prohibited to change the original schema/DTD unless and until you are not creator of your own Struts TAG !
This Struts TAG has there own working java TAG code, see this file, which comes with exception trace
So when that search.jsp file complies and run (when request comes for it ), The class FormTag.java (for html:form) throws an NPE , cause he's expecting an valid value for "action" variable , but it's not coming at all, because your DTD modifications !
shabarish vai
Ranch Hand
Joined: May 26, 2008
Posts: 79
posted
0
now will the control go inside <action> tag? if i provide html:form with action? like<html:form action="search.do">