Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

404 error

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
princehyderabad
Asked:
princehyderabad
4 Solutions
 
princehyderabadAuthor Commented:
Now I'm getting this error:
503 Unavailable

javax.servlet.UnavailableException: Parsing error processing resource path
0
 
radarshCommented:
princehyderabad,

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

Should be

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

_________
radarsh
0
 
radarshCommented:
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!

 
runa_paathakCommented:
Why are you extending HttpServlet if you are using Struts? Shouldn't you be writing Action classes?
0
 
gksinghietCommented:
Have you deployed InsertQuestion in web.xml?
0
 
pankilmpatelCommented:
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
 
princehyderabadAuthor Commented:
>>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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now