404 not found

X

Xeth Waxman

Greetings:
I am unable to get the tomcat server bundled with netbeans (v3.6) to
recognize my servlet. The front-end jsp will render, but when
clicking on the form's submit button, I get a 404 "resource not
available" message. The only mention of this in netbeans can be found
here (http://www.netbeans.org/kb/faqs/web_apps.html#21). My web.xml
is now configured as follows:

....
<servlet>
<servlet-name>ClaimForCredit</servlet-name>
<servlet-class>com.gcc.ClaimForCredit</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ClaimForCredit</servlet-name>
<url-pattern>/claimforcredit</url-pattern>
</servlet-mapping>

and is invoked from the form with the following tag:

<FORM METHOD="POST" ACTION="/servlet/com.gcc.claimforcredit">

Does anyone have any idea what I should do next? I have a standalone
install of Tomcat 5 installed, and it does the same thing, so I don't
think it's a netbeans specific issue. The servlet is in
<project-root>/WEB-INF/classes/com/gcc/ Thanks.

Xeth Waxman
(e-mail address removed)
 
R

Ryan Stewart

....
<url-pattern>/claimforcredit</url-pattern> ....
<FORM METHOD="POST" ACTION="/servlet/com.gcc.claimforcredit">

Does anyone have any idea what I should do next?
You should make the form's action point to "claimforcredit" since that's
what you defined in the descriptor.
 
W

William Brogden

Greetings:
I am unable to get the tomcat server bundled with netbeans (v3.6) to
recognize my servlet. The front-end jsp will render, but when
clicking on the form's submit button, I get a 404 "resource not
available" message. The only mention of this in netbeans can be found
here (http://www.netbeans.org/kb/faqs/web_apps.html#21). My web.xml
is now configured as follows:

...
<servlet>
<servlet-name>ClaimForCredit</servlet-name>
<servlet-class>com.gcc.ClaimForCredit</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ClaimForCredit</servlet-name>
<url-pattern>/claimforcredit</url-pattern>
</servlet-mapping>

and is invoked from the form with the following tag:

<FORM METHOD="POST" ACTION="/servlet/com.gcc.claimforcredit">

AHA! the imfamous "invoker" servlet usage. In Tomcat 4 and on
the invoker is disabled. Read this FAQ at JavaRanch

http://faq.javaranch.com/view?InvokerServlet

Basically you will have to use a URL that reflects your
<url-pattern> declaration. That ACTION URL with /servlet/
requires the invoker.
 
C

Cid

Basically you will have to use a URL that reflects your
<url-pattern> declaration. That ACTION URL with /servlet/
requires the invoker.

Right on. So, if it wasn't clear, you want your form ACTION something
like ACTION="/claimforcredit" to match the url-pattern you specified.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top