This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes Regarding html:link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Regarding html:link" Watch "Regarding html:link" New topic
Author

Regarding html:link

Govind Rajith
Greenhorn

Joined: Feb 15, 2007
Posts: 12
Hello,

I have a link which when clicked should pop-up a new window. I called a java Script function in the onClick of html:link but it shows an error message something like this:

javax.servlet.ServletException: Exception forwarding for name redirect: javax.servlet.ServletException: Cannot create rewrite URL: java.net.MalformedURLException: You must specify exactly one of "forward", "href", "page" or "action"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.index_jsp._jspService(index_jsp.java:68)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

javax.servlet.jsp.JspException: Exception forwarding for name redirect: javax.servlet.ServletException: Cannot create rewrite URL: java.net.MalformedURLException: You must specify exactly one of "forward", "href", "page" or "action"
org.apache.struts.taglib.logic.ForwardTag.doForward(ForwardTag.java:125)
org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:105)
org.apache.jsp.index_jsp._jspx_meth_logic_forward_0(index_jsp.java:85)
org.apache.jsp.index_jsp._jspService(index_jsp.java:59)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


Can anyone tell me what this error is. Also mention if any more details are to be included.

Regards
Govind Rajith
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
What this message is telling you is that you must specify either an href, page, or action attribute with the <html:link> tag whether you use them or not. In this case, where you're using the onclick event to do the work, you just want to nullify the normal action that would take place as a result of the user clicking on the link. To do this, simply specify javascript:void(0) as the link. Example:


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding html:link
 
Similar Threads
DBForms problem
exception in jsf
getting a 500 error
Exception when starting off with struts
Not able to forward to welcome page