Solved

404 error

Posted on 2006-06-27
7
240 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how do i compare an object based on two fields 6 49
Java JRE greater than 1.6 5 51
print map entry 34 55
why cannot we forward request once the response is committed 2 33
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now