Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Is web.xml being updated correctly
Is web.xml being updated correctly [message #161623] Wed, 22 February 2006 16:20 Go to next message
Eclipse UserFriend
Originally posted by: a.b.com

As a user of IBM WSAD/RAD for 5 years, I have written hundreds of JSPs and
dozens of servlets. Now I am using WTP 1.0 and Tomcat, since my customer
chooses to use that.
I am having some difficulties, which may be interpreted as RAD withdrawal
symptoms.

I created a new Web project called "second", chose to call the source
directory JavaSource since that is what I am used to, and created a simple
JSP called "test" in it, and ran it on the tomcat server. It ran correctly.
So far no problem.

Now I created a servlet in the JavaSource directory (in a valid package)
called "TestServlet" using the WTP servlet wizard, and added a minimal
number of lines of code to the doGet() method. I saved the servlet, which
took 5+ minutes at 100% cpu to complete, and looked at the web.xml in
WebContent/WEB-INF folder, and it had been updated by the wizard. I tried
to run the servlet and after another 5+ minute wait at 100% cpu for it do
deploy, I got the following page displayed:

| HTTP Status 404 - /second/TestServlet
|
| type Status report
| message /second/TestServlet
| description The requested resource (/second/TestServlet) is not
available.
|
| Apache Tomcat/5.0.30

I made no changes at this point. I just retried the JSP that had worked
before. Now after the 5+ minute delay again (lord knows why it needs to
republish when I have made no changes), I see the following page:

| HTTP Status 404 - /TestServlet/test.jsp
|
| type Status report
| message /TestServlet/test.jsp
| description The requested resource (/TestServlet/test.jsp) is not
available.
|
| Apache Tomcat/5.0.30



I have some questions:



1. What does it take to get a simple minimal servlet to execute under WTP
1.0?

2. Why does WTP change the web.xml so a JSP that previously worked no
longer works?

3. Why does WTP use build/classes instead of WEB-INF/classes as the default
destination for class files? Is there a standard? What is correct?
Re: Is web.xml being updated correctly [message #161731 is a reply to message #161623] Thu, 23 February 2006 13:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wknauf_NO_._INSIDE_hg-online.de

Hi Chris,

as soon as you add a servlet to your dynamic web project the XDoclet builder is
activated and thus re-creates web.xml each time you build your project.
To switch it off: go to "project properties" -> "Project facets" -> "Add/Remove
project facets" and uncheck "WebDoclet".
Here's a screenshot just to show what I mean:
http://www.informatik.fh-wiesbaden.de/~knauf/SWTVertiefung20 05/jboss/stateless/importxdoclet4.png

In the servlet you will find the XDoclet information which declares the servlet
and the URL pattern:
* @web.servlet
* name="TestServlet"
* display-name="TestServlet"
*
* @web.servlet-mapping
* url-pattern="/TestServlet"

Hope this helps

Wolfgang

Chris Gage wrote:

>
> I have some questions:
>
>
>
> 1. What does it take to get a simple minimal servlet to execute under WTP
> 1.0?
>
> 2. Why does WTP change the web.xml so a JSP that previously worked no
> longer works?
>
> 3. Why does WTP use build/classes instead of WEB-INF/classes as the default
> destination for class files? Is there a standard? What is correct?
>
>
>
>
Re: Is web.xml being updated correctly [message #161815 is a reply to message #161731] Thu, 23 February 2006 19:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.b.com

Wolfgang,

Thanks for this interesting piece of information - more stuff to learn!!!!
BUT... My project does not in fact have the WebDoclet facet enabled. I did
not select it when I created the project. But WTP still edits my web.xml
with bad data. I can invoke the servlet from a browser manually with the
correct url but selecting the servlet or jsp and then doing
RightButton-->Run As-->Run on Server generates a URL that NEVER works.
Re: Is web.xml being updated correctly [message #161959 is a reply to message #161815] Fri, 24 February 2006 16:26 Go to previous message
Eclipse UserFriend
Originally posted by: wknauf_NO_._INSIDE_hg-online.de

Hi Chris,

if you are having problems with the context root: there are several posts in
this group dealing with problems to change it.

For the facet: this one is enabled when you add a servlet with the wizard to it.
It may be that it is not enabled but the XDoclet builder is enabled: take a look
at "properties" -> "builders", there you can uncheck the XDoclet builder.

Hope this helps

Wolfgang

Chris Gage wrote:
> Wolfgang,
>
> Thanks for this interesting piece of information - more stuff to learn!!!!
> BUT... My project does not in fact have the WebDoclet facet enabled. I did
> not select it when I created the project. But WTP still edits my web.xml
> with bad data. I can invoke the servlet from a browser manually with the
> correct url but selecting the servlet or jsp and then doing
> RightButton-->Run As-->Run on Server generates a URL that NEVER works.
>
>
Previous Topic:WTP 1.0 - Sun AppServer 8.1 - debug
Next Topic:How to eliminate server from generic server when a specific adapter is available.
Goto Forum:
  


Current Time: Thu Apr 25 22:31:24 GMT 2024

Powered by FUDForum. Page generated in 0.02549 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top