javax.servlet.jsp.JspException: Cannot create redirect URL: java.net.MalformedURLException: Cannot retrieve ActionForward named welcomefile
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   haripriya_amaresan
Posted On:   Monday, March 21, 2011 08:02 PM

HI, I am new to struts and thought of developing a simple struts file. welcomefile.jsp this is my index.jsp <%@ taglib uri="/tags/struts-logic" prefix="logic" %> <%-- Redirect default requests to Welcome global ActionForward. By using a redirect, the user-agent will change address to match the path of our Welcome ActionForward. --%> and this is my struts-config entry name="welcomefile" path="/WelcomeFile.do"/> path="/welcomefile" forward="/pages/WelcomeFile.jsp"/> an   More>>

HI,

I am new to struts and thought of developing a simple struts file. welcomefile.jsp

this is my index.jsp

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>


<%--

Redirect default requests to Welcome global ActionForward.
By using a redirect, the user-agent will change address to match the path of our Welcome ActionForward.

--%>


and this is my struts-config entry



name="welcomefile"
path="/WelcomeFile.do"/>







path="/welcomefile"
forward="/pages/WelcomeFile.jsp"/>


and finally WelcomeFile.jsp

<%@taglib uri="/tags/struts-bean" prefix="bean"%>
<%@taglib uri="/tags/struts-html" prefix="html"%>












but i get the exception

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot create redirect URL: java.net.MalformedURLException: Cannot retrieve ActionForward named welcomefile
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)



please help to resolve this    <<Less

Re: javax.servlet.jsp.JspException: Cannot create redirect URL: java.net.MalformedURLException: Cannot retrieve ActionForward named welcomefile

Posted By:   Raaja_G  
Posted On:   Friday, April 1, 2011 06:44 AM

Hi,

Try this it will come. The path mentioned in global forwards and in actions path attribute should be same

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%-- Redirect default requests to Welcome global ActionForward. By using a redirect, the user-agent will change address to match the path of our Welcome ActionForward. --%> and this is my struts-config entry














and finally WelcomeFile.jsp

<%@taglib uri="/tags/struts-bean" prefix="bean"%>

<%@taglib uri="/tags/struts-html" prefix="html"%>





<bean:message key="welcomefile.title"/>












About | Sitemap | Contact