tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mehdi.Ne...@bluewave.com
Subject RE: JSP help: A bit off topic
Date Fri, 03 Jan 2003 15:09:44 GMT

Hi,

You should not *have* to use a useBean in order to instantiate a class.   I
did not see in the example you posted, where you actually created an
Object.. your code was :

 myClass myObject;
 myObject.getSomeString() /* This will actually contain all the code in
 JSP, just to avoid the JSP page cluttered with Java Code */

.. but no-where was there a myObject = new myClass();

ie :

myClass myObject = new myClass();
myObject.getSomeString()

until you do this, there is no object, just a ref, so you can't call
methods on it.

Thanks,

Mehdi Nejad



                                                                                         
                                       
                      "Laxmikanth M.S."                                                  
                                       
                      <laxmikanth.ms@sonata-so        To:       Tomcat Users List <tomcat-user@jakarta.apache.org>
              
                      ftware.com>                     cc:                             
                                          
                                                      Subject:  RE: JSP help: A bit off topic
                                   
                      03/01/2003 10:15                                                   
                                       
                      Please respond to                                                  
                                       
                      "Tomcat Users List"                                                
                                       
                                                                                         
                                       
                                                                                         
                                       




I don't see useBean Tag ....if u want to use a class use UseBean and call
the methos using the bean...


> -----Original Message-----
> From:            Raj [SMTP:n_rajmohan@chennai.tcs.co.in]
> Sent:            Friday, January 03, 2003 3:42 PM
> To:        Tomcat Users List
> Subject:         JSP help: A bit off topic
>
> Hi,
> This doesn't exactly relate to Tomcat, but it is a general JSP query. You
> see, I am using a set of Java classes, packaged as CTG (CICS Transaction
> Gateway) provided by IBM. My problem is, I am able to instantiate a CTG
> object inside the JSP. For example, in the JSP, if I write
>
> <html>
> <blah blah blah>
> <%
> CTGClass ctgObject = blah blah blah
> ............
> .........
> %>
> <b><%=ctgObject.getSomeString()%><b>
>
>
> This works fine. But when I write all this code inside my class, and say
>
> <html>
> <blah blah blah>
> <%
> myClass myObject;
> myObject.getSomeString() /* This will actually contain all the code in
> JSP, just to avoid the JSP page cluttered with Java Code */
>
> But this doesn't work. This problem is not only with CTG but many other
> classes, too. One interesting observation is, if I add a main to myClass
> and run it from the command prompt, it works perfectly.
>
> Any help?
> Raj
>    << File: InterScan_SafeStamp.txt >>  << File: ATT12098.txt >>
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should
destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************

--
To unsubscribe, e-mail:   <
mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:tomcat-user-help@jakarta.apache.org>






--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message