Solved

404 error

Posted on 2006-06-27
7
242 Views
Last Modified: 2008-02-01
hi experts,

simple error. My hosting compnay using resin 2.0 and I;m having this 404 error, even though everything is in place.

404 Not Found
/InsertQuestion was not found on this server.


JSP:
<FORM action="QuestionSubmit.do" method="POST">
...

STRUTS-CONFIG.xml

<action path="/QuestionSubmit"  type="org.apache.struts.actions.ForwardAction" parameter="/com.xxx.InsertQuestion"> </action>
also tried
<action path="/QuestionSubmit"  type="org.apache.struts.actions.ForwardAction" parameter="/InsertQuestion"> </action>


Java:
..
public class InsertQuestion extends HttpServlet implements Servlet {

      public void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
...
getServletContext().getRequestDispatcher("/QuestionTest.jsp?ID="+rowid+"n="+name).forward(req,resp);
..
..


And I have placed class files: <web-inf>/<class>/<com>/<xxx>class files...

also I placed my class files in root <dir> and <web-inf> just to try... but still didnt worked.

Where am I going wrong.

Thx,
PH


0
Comment
Question by:princehyderabad
7 Comments
 

Author Comment

by:princehyderabad
ID: 16997660
Now I'm getting this error:
503 Unavailable

javax.servlet.UnavailableException: Parsing error processing resource path
0
 
LVL 10

Expert Comment

by:radarsh
ID: 16998726
princehyderabad,

>> <web-inf>/<class>/<com>/<xxx>class files...

Should be

>> <web-inf>/<classes>/<com>/<xxx>class files...

_________
radarsh
0
 
LVL 10

Assisted Solution

by:radarsh
radarsh earned 20 total points
ID: 16998729
Also,

>> getServletContext().getRequestDispatcher("/QuestionTest.jsp?ID="+rowid+"n="+name).forward(req,resp);

Should be

>> getServletContext().getRequestDispatcher("/QuestionTest.jsp?ID="+rowid+"&n="+name).forward(req,resp);

_________
radarsh
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Assisted Solution

by:runa_paathak
runa_paathak earned 20 total points
ID: 16998800
Why are you extending HttpServlet if you are using Struts? Shouldn't you be writing Action classes?
0
 
LVL 5

Assisted Solution

by:gksinghiet
gksinghiet earned 20 total points
ID: 16999153
Have you deployed InsertQuestion in web.xml?
0
 
LVL 2

Accepted Solution

by:
pankilmpatel earned 20 total points
ID: 16999702
Hi Prince,

Change ur web.xml file as following.
<servlet>
            <servlet-name>InsertQuestion</servlet-name>
            <display-name>InsertQuestion</display-name>
            <servlet-class>com.xxx.InsertQuestion</servlet-class>
</servlet>

<servlet-mapping>
            <servlet-name>InsertQuestion</servlet-name>
            <url-pattern>/InsertQuestion</url-pattern>
</servlet-mapping>
0
 

Author Comment

by:princehyderabad
ID: 17004508
>>Why are you extending HttpServlet if you are using Struts? Shouldn't you be writing Action classes?

You are right "runa_paathak" I should be using action. I was just trying to follow example set by "pankilpatel"

I was able to do same with Action, but only thing I'm missing or dont know is how to pass paramenter to JSP  from Action class.

thanks for all.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 64
ejb on wildfly 5 45
eclipse console opening separately 2 35
American Express @Work site and Java 4 63
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question