Solved

404 error

Posted on 2006-06-27
7
239 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
copyEndy  challenge 15 55
mapBully challenge 6 89
HashMap Vs TreeMap 12 49
Requested array size exceeds VM limit 3 48
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

706 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

18 Experts available now in Live!

Get 1:1 Help Now