You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shyam Anand <st...@yahoo.com> on 2005/10/19 20:49:52 UTC

issue with on JDK 1.4.2

Hi,

I'm doing an upgrade from JDK 1.3.1 to JDK 1.4.2 for
my Struts 1.1 applications. I have an issue with the
<logic:present> tags. These don't seem to work with
JDK 1.4.2 version.
I'm using OC4J 9.0.4 as my application server.

For the JSP code snippet shown below , I get an error
message:

quote:
JspServlet: unable to dispatch to requested page:
oracle.jsp.provider.JspCompileException: <H3>Errors
compiling:[jsp src:line #:133]<br> cannot resolve
symbol: variable userRequest 

unquote:


###################
<logic:present name="userRequest" scope="session">

<bean:define id="userRequest" name="userRequest"
scope="session" type="dsap.business.UserRequest"/>
<bean:define id="employee" name="userRequest"
property="employee" type="dsap.business.Employee" />
<bean:define id="userModuleList" name="userRequest"
property="userModuleList" />

</logic:present>
#######################


This used to work well with JDK 1.3.1.

Could somebody suggest a solution or a workaround ? I
would not want to use JSTL.

Any help will be greatly appreciated.

Thanks,
Shyam


		
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: issue with on JDK 1.4.2

Posted by Shyam Anand <st...@yahoo.com>.
Laurie,

Thanks for your reply.I'm not sure if I understand you
clearly.I have used bean:define inside the
logic:present tag as seen in the code snippet.This is
supposed to define a scripting variable named by the
"id" attribute as described in the Struts docs:

"Create a new attribute (in the scope specified by the
toScope property, if any), and a corresponding
scripting variable, both of which are named by the
value of the id attribute"

http://struts.apache.org/struts-taglib/tagreference-struts-bean.html

The issue I have is that the scripting variable
"userRequest" is not created by the bean:define tag
inside the logic:present tag.

Instead "userRequest" is created as a pageContext
attribute. So, if I use the scriptlet below to access
the pageContext attributes, my code works:

---------
<% dsap.business.UserRequest userRequest =
(dsap.business.UserRequest)pageContext.getAttribute("userRequest");
%>
				<% dsap.business.Employee employee =
(dsap.business.Employee)pageContext.getAttribute("employee");
%>

<html:text name="formBean" property="reqType"
 value="<%=userRequest.getReqType()%>" />
----------

Anyway, the same code (bean:define embedded inside
logic tags) used to work perfectly with the previous
version of my server (JSP 1.1).So, I'm puzzled why it
doesn't work with the latest version of my server -
OC4J 9.0.4 (JSP 1.2).

Could this be some JSP 1.1 - 1.2 compatibility issue?

Shyam

--- Laurie Harper <la...@holoweb.net> wrote:

> You're checking whether userRequest exists as a
> session attribute, then 
> trying to access it as a scripting variable. The one
> doesn't imply you 
> can do the other. If you need to access userRequest
> from scriptlets, 
> you'll need to use <bean:define/> to create the
> scripting variable or 
> lookup the bean in the session in your scriptlet:
> 
>   
>
<%=session.getAttribute("userRequest").getReqType()%>
> 
> L.
> 
> Shyam Anand wrote:
> > I figured that it's not a JDK issue and it is an
> > application server issue. I use OC4J (Oracle IAS)
> and
> > I'm upgrading from a version that supports JSP 1.1
> to
> > the one that is certified for JSP 1.2.
> > So, could this be a JSP 1.1 - 1.2 compatibility
> issue?
> > 
> > The JSP Compiler of the OC4J container doesn't
> seem to
> > recognize the bean:define tags embedded inside
> Struts
> > logic tags. 
> > 
> > See JSP code snippet below:
> > 
> > <logic:present name="userRequest" scope="session">
> > 
> > <bean:define id="userRequest" name="userRequest"
> > scope="session" type="dsap.business.UserRequest"/>
> > <bean:define id="employee" name="userRequest"
> > property="employee" type="dsap.business.Employee"
> />
> > <bean:define id="userModuleList"
> name="userRequest"
> > property="userModuleList" />
> > 
> > </logic:present>
> > 
> > And I get an error message when I access the
> > "userRequest" bean's properties in my JSP:
> > 
> > eg.
> > <html:text name="formBean" property="reqType"
> > value="<%=userRequest.getReqType()%>" />
> > 
> > Error:
> > JspServlet: unable to dispatch to requested page:
> > oracle.jsp.provider.JspCompileException: Errors
> > compiling:[jsp src:line #:133] cannot resolve
> symbol:
> > variable userRequest 
> > 
> > Any idea on what could be wrong here? Is there any
> > workaround for this?
> > 
> > I would not want to use JSTL as I have some time
> > constraints.
> > 
> > Any help will be greatly appreciated.
> > 
> > Thanks,
> > Shyam
> > 
> > 
> > --- Dave Newton <ne...@pingsite.com> wrote:
> > 
> > 
> >>Shyam Anand wrote:
> >>
> >>
> >>>I have issues with struts-logic tags...I'm not
> >>
> >>using JSTL.
> >>
> >>> 
> >>>
> >>
> >>Whoops.
> >>
> >>I'm running 1.4.2 w/o any struts tag issues
> >>(including 'logic'). 
> >>(Tomcat, WinXP, 1.4.2_08)
> >>
> >>Why not switch to JSTL anyway, though?
> >>
> >>Dave
> >>
> >>
> >>
> >>
> > 
> >
>
---------------------------------------------------------------------
> > 
> >>To unsubscribe, e-mail:
> >>user-unsubscribe@struts.apache.org
> >>For additional commands, e-mail:
> >>user-help@struts.apache.org
> >>
> >>
> > 
> > 
> > 
> > 
> > 		
> > __________________________________ 
> > Yahoo! FareChase: Search multiple travel sites in
> one click.
> > http://farechase.yahoo.com
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: issue with on JDK 1.4.2

Posted by Laurie Harper <la...@holoweb.net>.
You're checking whether userRequest exists as a session attribute, then 
trying to access it as a scripting variable. The one doesn't imply you 
can do the other. If you need to access userRequest from scriptlets, 
you'll need to use <bean:define/> to create the scripting variable or 
lookup the bean in the session in your scriptlet:

   <%=session.getAttribute("userRequest").getReqType()%>

L.

Shyam Anand wrote:
> I figured that it's not a JDK issue and it is an
> application server issue. I use OC4J (Oracle IAS) and
> I'm upgrading from a version that supports JSP 1.1 to
> the one that is certified for JSP 1.2.
> So, could this be a JSP 1.1 - 1.2 compatibility issue?
> 
> The JSP Compiler of the OC4J container doesn't seem to
> recognize the bean:define tags embedded inside Struts
> logic tags. 
> 
> See JSP code snippet below:
> 
> <logic:present name="userRequest" scope="session">
> 
> <bean:define id="userRequest" name="userRequest"
> scope="session" type="dsap.business.UserRequest"/>
> <bean:define id="employee" name="userRequest"
> property="employee" type="dsap.business.Employee" />
> <bean:define id="userModuleList" name="userRequest"
> property="userModuleList" />
> 
> </logic:present>
> 
> And I get an error message when I access the
> "userRequest" bean's properties in my JSP:
> 
> eg.
> <html:text name="formBean" property="reqType"
> value="<%=userRequest.getReqType()%>" />
> 
> Error:
> JspServlet: unable to dispatch to requested page:
> oracle.jsp.provider.JspCompileException: Errors
> compiling:[jsp src:line #:133] cannot resolve symbol:
> variable userRequest 
> 
> Any idea on what could be wrong here? Is there any
> workaround for this?
> 
> I would not want to use JSTL as I have some time
> constraints.
> 
> Any help will be greatly appreciated.
> 
> Thanks,
> Shyam
> 
> 
> --- Dave Newton <ne...@pingsite.com> wrote:
> 
> 
>>Shyam Anand wrote:
>>
>>
>>>I have issues with struts-logic tags...I'm not
>>
>>using JSTL.
>>
>>> 
>>>
>>
>>Whoops.
>>
>>I'm running 1.4.2 w/o any struts tag issues
>>(including 'logic'). 
>>(Tomcat, WinXP, 1.4.2_08)
>>
>>Why not switch to JSTL anyway, though?
>>
>>Dave
>>
>>
>>
>>
> 
> ---------------------------------------------------------------------
> 
>>To unsubscribe, e-mail:
>>user-unsubscribe@struts.apache.org
>>For additional commands, e-mail:
>>user-help@struts.apache.org
>>
>>
> 
> 
> 
> 
> 		
> __________________________________ 
> Yahoo! FareChase: Search multiple travel sites in one click.
> http://farechase.yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: issue with on JDK 1.4.2

Posted by Shyam Anand <st...@yahoo.com>.
I figured that it's not a JDK issue and it is an
application server issue. I use OC4J (Oracle IAS) and
I'm upgrading from a version that supports JSP 1.1 to
the one that is certified for JSP 1.2.
So, could this be a JSP 1.1 - 1.2 compatibility issue?

The JSP Compiler of the OC4J container doesn't seem to
recognize the bean:define tags embedded inside Struts
logic tags. 

See JSP code snippet below:

<logic:present name="userRequest" scope="session">

<bean:define id="userRequest" name="userRequest"
scope="session" type="dsap.business.UserRequest"/>
<bean:define id="employee" name="userRequest"
property="employee" type="dsap.business.Employee" />
<bean:define id="userModuleList" name="userRequest"
property="userModuleList" />

</logic:present>

And I get an error message when I access the
"userRequest" bean's properties in my JSP:

eg.
<html:text name="formBean" property="reqType"
value="<%=userRequest.getReqType()%>" />

Error:
JspServlet: unable to dispatch to requested page:
oracle.jsp.provider.JspCompileException: Errors
compiling:[jsp src:line #:133] cannot resolve symbol:
variable userRequest 

Any idea on what could be wrong here? Is there any
workaround for this?

I would not want to use JSTL as I have some time
constraints.

Any help will be greatly appreciated.

Thanks,
Shyam


--- Dave Newton <ne...@pingsite.com> wrote:

> Shyam Anand wrote:
> 
> >I have issues with struts-logic tags...I'm not
> using JSTL.
> >  
> >
> Whoops.
> 
> I'm running 1.4.2 w/o any struts tag issues
> (including 'logic'). 
> (Tomcat, WinXP, 1.4.2_08)
> 
> Why not switch to JSTL anyway, though?
> 
> Dave
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: issue with on JDK 1.4.2

Posted by Dave Newton <ne...@pingsite.com>.
Shyam Anand wrote:

>I have issues with struts-logic tags...I'm not using JSTL.
>  
>
Whoops.

I'm running 1.4.2 w/o any struts tag issues (including 'logic'). 
(Tomcat, WinXP, 1.4.2_08)

Why not switch to JSTL anyway, though?

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: issue with on JDK 1.4.2

Posted by Shyam Anand <st...@yahoo.com>.
I have issues with struts-logic tags...I'm not using
JSTL.

Shyam

--- Dave Newton <ne...@pingsite.com> wrote:

> Shyam Anand wrote:
> 
> >These don't seem to work with JDK 1.4.2 version.
> >  
> >
> I'm running 1.4.2 w/o any JSTL issues. (Tomcat,
> WinXP, 1.4.2_08)
> 
> Dave
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: issue with on JDK 1.4.2

Posted by Dave Newton <ne...@pingsite.com>.
Shyam Anand wrote:

>These don't seem to work with JDK 1.4.2 version.
>  
>
I'm running 1.4.2 w/o any JSTL issues. (Tomcat, WinXP, 1.4.2_08)

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org