aspose file tools
The moose likes Struts and the fly likes cannot see index.jsp in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "cannot see index.jsp in struts" Watch "cannot see index.jsp in struts" New topic
Author

cannot see index.jsp in struts

pep grifell
Greenhorn

Joined: Jul 17, 2002
Posts: 1
Hi!
I'm using struts 1.1. I have a index.jsp page shows all the categories of books I have in a DB. In struts-config.xml I have :
<action path="/index"
type="com.mtp.store.action.CategoryAction"
scope="request"
validate="false">
>
<forward name="Success" path="/index.jsp"/>
</action>
and in web.xml :
...
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>/WEB-INF/classes/ApplicationResources</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
...
so when I call index.jsp, I would like that CategoryAction access the db and return a vector of Strings. In CategoryAction I have :
...
request.setAttribute("categories", categories);
forward = mapping.findForward("Success");
return forward;
...
where categories is the Vector.
I have putsome println at the beginning of the execute method but I cannot see any.
When I call : localhost:8080/bookstore/index.jsp
in the prompt appears :
action: Processing a GET for /index
action: Setting locale 'en_US'
Looking for Action instance for class com.mtp.store.action.CategoryAction
action: Double checking for Action instance already there
action: Creating new Action instance
and stops here. Then the the index.jsp appears without any code.
Does anyone know the problem ???
Thanks !!!
Erik Hatcher
Author
Ranch Hand

Joined: Jun 11, 2002
Posts: 111
I would venture a guess and say that its working ok up to the index.jsp and perhaps what you've got there is causing the problem. What does your browser get from View Source? What is in your JSP page?


Co-author of Lucene in Action
pilania
Greenhorn

Joined: Mar 20, 2000
Posts: 26
I think you should have a form-bean defined. wherein form-bean will have logic to get data from database and populate html.
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
pilania,
JavaRanch has a naming
policy
which is strictly enforced. Please read the policy and change your
display name if you wish to continue posting here.
You can change your name:
here


Matthew Phillips
Dustin Marx
Ranch Hand

Joined: Mar 06, 2001
Posts: 40
I recommend, if this is still a problem, that you make sure that your action class (com.mtp.store.action.CategoryAction) extends the Struts Action class. If it does not extend this class, you can get a message like the one you are seeing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cannot see index.jsp in struts
 
Similar Threads
Error while deploying struts application
problem with the unfolding of an application
Error: creating bean of class (HELP THE NEWBE)
problem in seperate modules in struts
Chaining filter servlet