aspose file tools*
The moose likes Struts and the fly likes Parsing error processing resource path ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Parsing error processing resource path ?" Watch "Parsing error processing resource path ?" New topic
Author

Parsing error processing resource path ?

harish pathak
Ranch Hand

Joined: Dec 17, 2005
Posts: 51
Hi All,

I am getting the following error:

-------------------------
Parsing error processing resource path.
------------------------
while running my first struts application.

following are my jsp and java file

regSuccess.jsp
----------------------
<html>
<head>
<title>
User Registration Was Successful!
</title>
</head>
<body>
<h1>User Registration Was Successful!</h1>
</body>
</html>
----------------------

strutsapp1/ (its a package inside classes directory)
UserRegistrationAction.java
-------------------------------
package strutsapp1;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class UserRegistrationAction extends Action
{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
return mapping.findForward("success");

}
}
-------------------------------
struts-config.xml is as:

-----------------------
<action-mappings>
<action path="/userRegistration"
type="strutsapp1.UserRegistrationAction">
<forward name="success" path="/regSuccess.jsp"/>
</action>


</action-mappings>
-------------------------
web.xml file is as:

---------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<display-name>Struts Example Application</display-name>

<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
...
<load-on-startup>2</load-on-startup>
</servlet>



<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

-------------------------------

So please look into the code and answer please.
What could be the problem.?

Thanks in advance
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
how u will make a request

This is a way to make a request, such that it display regSuccess.jsp
http://localhost portnumber)/(projectname)/userRegistration.do
Ganesh Kumar Kalamadugu
Greenhorn

Joined: Jan 14, 2006
Posts: 4
Originally posted by harish pathak:
Hi All,

I am getting the following error:

-------------------------
Parsing error processing resource path.
------------------------
while running my first struts application.

following are my jsp and java file

regSuccess.jsp
----------------------
<html>
<head>
<title>
User Registration Was Successful!
</title>
</head>
<body>
<h1>User Registration Was Successful!</h1>
</body>
</html>
----------------------

strutsapp1/ (its a package inside classes directory)
UserRegistrationAction.java
-------------------------------
package strutsapp1;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class UserRegistrationAction extends Action
{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
return mapping.findForward("success");

}
}
-------------------------------
struts-config.xml is as:

-----------------------
<action-mappings>
<action path="/userRegistration"
type="strutsapp1.UserRegistrationAction">
<forward name="success" path="/regSuccess.jsp"/>
</action>


</action-mappings>
-------------------------
web.xml file is as:

---------------------------

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<display-name>Struts Example Application</display-name>

<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
...
<load-on-startup>2</load-on-startup>
</servlet>



<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

-------------------------------

So please look into the code and answer please.
What could be the problem.?

Thanks in advance





change ur jsp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<HTML>
<BODY>
<html:errors />

<html:form action="userRegistration.do">

<table>
<tr>
Product
</td>
<td><html:text property="symbol"/> </td>
</tr>
<tr><html:submit/></tr>
</table>
</html:form>
</BODY>
</HTML>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing error processing resource path ?