Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding html:link

 
Govind Rajith
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic