Solved

404 error

Posted on 2006-06-27
7
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

617 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