Hey!

I have a problem that is driving me nuts.

This may be better posted to JSP-INTEREST.
Please let me know.

For IBM WebSphere you put your servlet code
in the WebApp directory servlets and your
JSP in the directory web.  This similar to
your use of WEB-INF.

For testing I have a Properties servlet which
is called by a Properties.jsp.

Properties.jsp looks like this:

...
<form METHOD="POST"
      ACTION="/webapp/DataXWebApp/servlet/Properties"
      ENCTYPE="x-www-form-encoded">
...

After I run Properties.jsp the first time I get the
expected response from the Properties servlet.

In the doPost()

I do this:

...
// Set MIME content-type for response
resp.setContentType("text/html");
// Next three lines prevent dynamic content from being cached
// on browsers.
resp.setHeader("Pragma", "no-cache");
resp.setHeader("Cache-Control", "no-cache");
resp.setDateHeader("Expires", 0);

// Obtain a print writer to output our HTML form
PrintWriter out = resp.getWriter();

// I do some out.println()s
// Then out.flush() and out.close() when I'm done.
...

Nothing new above.  The servlet code worked before.
Only two things changed.
Instead of being served from the default servlets
directory, it is served from the WebApp servlets
directory.
Second, Properties.jsp was Properties.html with
     ACTION="/servlet/Properties". (see above ACTION)

Running Properties.jsp a second time produces this
error message (partial).


java.lang.ClassFormatError: Wrong name
        at java.lang.ClassLoader.defineClass(ClassLoader.java:227)
        at com.sun.jsp.runtime.JspLoader.findClass(Compiled Code)
        at com.sun.jsp.runtime.JspLoader.loadClass(JspLoader.java:126)
        at com.sun.jsp.runtime.JspLoader.loadJSP(JspLoader.java:205)
        at
com.sun.jsp.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:99)

        at
com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:110)

        at
com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:400)
        at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:510)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:639)
        at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:557)

JSP is throwing this.

I know how to work around this. But
I would like for someone to try this on
a different Servlet Engine besides IBM WebSphere,
for it may be WebSphere's fault.

The work-around is this:

Change the name of the Properties.jsp to be
different from the servlet name of Properties.
I suspect there is a naming conflict.

My question to the Java servlet/JSP designers is this:

Let's say one has a large business application
where there is many JSPs, HTMLs, and servlets.

If one now has the concept of web-applications,
one would think that that they do not have to
be concerned with naming conflects like this.

Prior to web-applications, Properties.html and
Properties.class did not conflict, where now
Properties.jsp and Properties.class clash.

Somebody will remind me that JSPs are compiled
into class files. I say, so what.  The naming
conflicts should be handled gracefully.

While yous are looking at this posting, I will
be looking at the spec to see if there is any
words about this.

Sans adieu,
Danny Rubis

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to