Re: jsp:useBean / Scope Bug in 4.01 !

2002-02-08 Thread L Rutker

Back to the basic question where in this code:
% if (request.getParameter(type)!= null 
 request.getParameter(type).equals(user)) { %
 jsp:useBean id=user class=com.rutker.UsrData scope=request/
% } else if(request.getParameter(type)!= null 
request.getParameter(type).equals(group)) { %
 jsp:useBean id=group class=com.rutker.GpData scope=request/
% } %


is there am i declaring the same ID twice?

Thanks
Lou


Hi,
Can you explain what you mean by:

  Duplicate ids found in the same translation unit
  shall result in a fatal translation error.

What is duplicate? I am declaring 2 seperate beans based on the condition.
Neither of them should be visible to the rest of the page. Yet they are
visible to Tomcat. The


JSP follows the XML syntax rules, which look at the *static* content of
your document at compile time.  As it examines the incoming text, it
discovers that, in fact, you *are* declaring the same ID twice --
conditional execution is a runtime thing, not a compile-time thing.

Short answer -- you can't do that.

Lou

Craig


From: Craig R. McClanahan [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Subject: Re: jsp:useBean / Scope Bug in 4.01 !
Date: Fri, 1 Feb 2002 14:41:57 -0800 (PST)



On Fri, 1 Feb 2002, L Rutker wrote:

  Date: Fri, 01 Feb 2002 12:59:34 -0500
  From: L Rutker [EMAIL PROTECTED]
  Reply-To: Tomcat Users List [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: jsp:useBean / Scope Bug in 4.01 !
 
  Hi,
  The following is a bug I found using Tomcat 4.01 on NT4
  The following code:
 
  % if (request.getParameter(type)!= null 
  request.getParameter(type).equals(user)) { %
  jsp:useBean id=user class=com.rutker.UsrData scope=request/
  % } else if(request.getParameter(type)!= null 
  request.getParameter(type).equals(group)) { %
  jsp:useBean id=group class=com.rutker.GpData scope=request/
  % } %
 
  should not be visible to the
  jsp:getProperty name=user property=firstName /  tag  farther down 
the
  page because the useBean tag was declared in the if block, yet the
  jsp:getProperty tag can see it and works in Tomcat. I noticed the bug 
when I
  tried the above code on WL 6.1 on Linux and it didnt work. I think that 
WL
  has the proper implementation.

I don't.  They are violating the JSP Specification if they support this.
In the JSP 1.3 Specification, Section 4.1 (page 68), you will find the
following statement:

 Duplicate ids found in the same translation unit
 shall result in a fatal translation error.

The fact that you are doing this inside scriptlet conditionals does not
change the fact that you are using two jsp:useBean elements with the
same id attribute in the same page.

  Is this the correct mailing list for this post?

The best place to report bugs is in the bug tracking system:

   http://nagoya.apache.org/bugzilla/


  Thanks
  Lou R.
 

Craig McClanahan


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]



_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: jsp:useBean / Scope Bug in 4.01 !

2002-02-04 Thread L Rutker

Hi,
Can you explain what you mean by:

 Duplicate ids found in the same translation unit
 shall result in a fatal translation error.

What is duplicate? I am declaring 2 seperate beans based on the condition. 
Neither of them should be visible to the rest of the page. Yet they are 
visible to Tomcat. The

Lou


From: Craig R. McClanahan [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Subject: Re: jsp:useBean / Scope Bug in 4.01 !
Date: Fri, 1 Feb 2002 14:41:57 -0800 (PST)



On Fri, 1 Feb 2002, L Rutker wrote:

  Date: Fri, 01 Feb 2002 12:59:34 -0500
  From: L Rutker [EMAIL PROTECTED]
  Reply-To: Tomcat Users List [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: jsp:useBean / Scope Bug in 4.01 !
 
  Hi,
  The following is a bug I found using Tomcat 4.01 on NT4
  The following code:
 
  % if (request.getParameter(type)!= null 
  request.getParameter(type).equals(user)) { %
  jsp:useBean id=user class=com.rutker.UsrData scope=request/
  % } else if(request.getParameter(type)!= null 
  request.getParameter(type).equals(group)) { %
  jsp:useBean id=group class=com.rutker.GpData scope=request/
  % } %
 
  should not be visible to the
  jsp:getProperty name=user property=firstName /  tag  farther down 
the
  page because the useBean tag was declared in the if block, yet the
  jsp:getProperty tag can see it and works in Tomcat. I noticed the bug 
when I
  tried the above code on WL 6.1 on Linux and it didnt work. I think that 
WL
  has the proper implementation.

I don't.  They are violating the JSP Specification if they support this.
In the JSP 1.3 Specification, Section 4.1 (page 68), you will find the
following statement:

 Duplicate ids found in the same translation unit
 shall result in a fatal translation error.

The fact that you are doing this inside scriptlet conditionals does not
change the fact that you are using two jsp:useBean elements with the
same id attribute in the same page.

  Is this the correct mailing list for this post?

The best place to report bugs is in the bug tracking system:

   http://nagoya.apache.org/bugzilla/


  Thanks
  Lou R.
 

Craig McClanahan



_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




jsp:useBean / Scope Bug in 4.01 !

2002-02-01 Thread L Rutker

Hi,
The following is a bug I found using Tomcat 4.01 on NT4
The following code:

% if (request.getParameter(type)!= null  
request.getParameter(type).equals(user)) { %
jsp:useBean id=user class=com.rutker.UsrData scope=request/
% } else if(request.getParameter(type)!= null  
request.getParameter(type).equals(group)) { %
jsp:useBean id=group class=com.rutker.GpData scope=request/
% } %

should not be visible to the
jsp:getProperty name=user property=firstName /  tag  farther down the 
page because the useBean tag was declared in the if block, yet the 
jsp:getProperty tag can see it and works in Tomcat. I noticed the bug when I 
tried the above code on WL 6.1 on Linux and it didnt work. I think that WL 
has the proper implementation.
Is this the correct mailing list for this post?
Thanks
Lou R.

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Config crashing Tomcat 4.01

2001-11-14 Thread L Rutker

Hi,
I am new at this and the way I mapped my servlet might be odd but crashing 
tomcat wasn't what I expected.
I am running Tomcat 4.01 standalone on NT 4 SP6
I am starting it using the shortcut provided by the installation (\Apache 
Tomcat 4.0\bin\bootstrap.jar start) and stopping it with the stop shortcut.

Here is what I did. My web.xml is as follows:
web-app
  servlet
  servlet-nameGenServlet/servlet-name
  servlet-classGenServlet/servlet-class
  /servlet
  servlet-mapping
  servlet-nameGenServlet/servlet-name
  url-pattern/controller/url-pattern
  /servlet-mapping
  servlet-mapping
  servlet-nameGenServlet/servlet-name
  url-pattern/GenServlet/url-pattern
   /servlet-mapping
!-- next mapping causes problems --
!--servlet-mapping
servlet-nameGenServlet/servlet-name
url-pattern/*/url-pattern
/servlet-mapping--
/web-app

It works and when I hit 
http://localhost:8080/anyservletName?action=addtype=user I get exactly what 
I expect.
But when I tested an oddball url as follows:
http://localhost:8080/?action=addtype=user just passing the params to 
nothing I get the index page (wasn't sure I would get the index page or the 
servlet- now I know). At this point any servlet or JSP I try to invoke the 
system throws a 500 Internal Server Error The root cause is: 
java.lang.StackOverflowError (the longest stack trace I have ever seen - not 
sure this is common in tomcat).
This in itself wouldn't be that bad if I could shut down Tomcat. It doesnt 
fully shut down using the shortcut (the start Tomcat window doesnt shut down 
a message appears Stopping service Tomcat-Standalone and it hangs. When I 
manually shut the window and kill every thread I can see that I think is 
associated with the process (java ones).
Note The problem as I know it is ONLY when trying to do a forward.
Just passing the servlet the parameters ?junk=someJunk will pose no problem. 
It is only when the parameter triggers the servlet to do a forward to a jsp 
page that causes the exception. The only way to restore it is to rebooot. I 
did clear out all the cache in the work folder.

Thanks in advance
Lou

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]