Bug 37933 - Bugs in Tomcat
Summary: Bugs in Tomcat
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Servlet & JSP API (show other bugs)
Version: 5.0.0
Hardware: PC Windows 2000
: P1 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2005-12-16 07:00 UTC by manokaran
Modified: 2006-02-27 11:39 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description manokaran 2005-12-16 07:00:20 UTC
I am manokaran.I wrote a program in tomcat using eclipse IDE. 

The code is as follows:

1.>This is a Bean:
package MMM;

public class Bean {
	private String name;
	public void SetName(String s)
	public String getName()
		return name;


 2.>This is a Servlet class:
package MMM;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Serv  extends HttpServlet{

	public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException
		Bean bean=new Bean();
		RequestDispatcher rd=request.getRequestDispatcher("india.jsp");
3.This is web.xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"


4.>This is Index.html file:
<form action=manokara.do>
<input type=submit>
5.>This is a JSP file:
<jsp:useBean id="mano1" class="MMM.Bean" scope="request" />
<jsp:getProperty name="mano" property="name"/>


      The setAttribute, Jsp UseBean ID  and getProperty name must be same.
this is the correct procedure. this format was working well in tomcat and all
web,application servers.  
      But the values set by me were : setAttribute("mano",ss),getProperty
useBean id="mano1". Observe that the useBean id is set different. 
     Hence logically, this must not work. But in my case it is working in
TOMCAT. The same code is not working in WEBLOGIC.
Comment 1 william.barker 2005-12-18 04:43:25 UTC
Yeah, well, it doesn't look like the spec will accept a previously defined 
Request-Attribute here (at least with the 'recommended' action), so you have a 

I'll have to look into it more to see if it's reasonable to do the compile-
time 'recommended' action, or if we will just have to do it at runtime.  In 
anycase, it won't be pretty :(.  

Comment 2 william.barker 2005-12-19 01:53:00 UTC
This is fixed now in the SVN trunk, and will appear in 5.5.15.

The fix raises a runtime error in your test case.  I don't see how to do it at 
translation time, but I'm happy to be proven wrong :).
Comment 3 william.barker 2006-02-27 20:39:26 UTC
*** Bug 38797 has been marked as a duplicate of this bug. ***