You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by hk <hy...@yahoo.com> on 2007/05/22 18:37:45 UTC

How can I access an attribute of session using JSP tags?

I tried to check and output an attribute of session in a jSP page, which I
had set in an action by using logic:present and bean:out tagas, but I
coulnd't. It seems like those are not a right tag.


-- 
View this message in context: http://www.nabble.com/How-can-I-access-an-attribute-of-session-using-JSP-tags--tf3797537.html#a10741921
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: How can I access an attribute of session using JSP tags?

Posted by Nuwan Chandrasoma <my...@gmail.com>.
hi,

if the attribute netblockflixter is a bean and thinking that it has a 
property called Login

Hi,

you can check it like this

<logic:present name="netblockflixter" property="Login">
</logic:present>

your equal comparison is wrong., based on what you have your checking if the 
Login property of the netblockflixter bean is equal to string "Boolean.TRUE"

Thanks,

Nuwan


----- Original Message ----- 
From: "hk" <hy...@yahoo.com>
To: <us...@struts.apache.org>
Sent: Tuesday, May 22, 2007 5:30 PM
Subject: Re: How can I access an attribute of session using JSP tags?


>
> In my JSP page, I have a code like below,
>
>  <logic:present name="netblockflixter.Login" scope="session">
>    <logic:equal value="Boolean.TRUE" property="netblockflixter.Login"
> scope="session">
>            Logout
>    </logic:equal>
>  <logic:notEqual value="Boolean.TRUE" property="netblockflixter.Login"
> scope="session">
>            Login
>   </logic:notEqual>
>  </logic:present>
>
> I think, logic:present tag can check the session bean, but in this case, 
> the
> "netblockflixter" is not a bean.
> How can I check the attribute in struts tag?
>
>
>
> Lance Semmens-3 wrote:
>>
>> I am saying the standard struts tags do check session scope if
>> scope="session" or no scope is provided, so it's probably a bug in your
>> code.
>>
>> Nuwan Chandrasoma wrote:
>>> Hi,
>>>
>>> I would go for JSTL tags, but i dont really get what you trying to say!
>>>
>>> Thanks,
>>>
>>> Nuwan
>>>
>>> ----- Original Message ----- From: "hk" <hy...@yahoo.com>
>>> To: <us...@struts.apache.org>
>>> Sent: Tuesday, May 22, 2007 4:37 PM
>>> Subject: How can I access an attribute of session using JSP tags?
>>>
>>>
>>>>
>>>> I tried to check and output an attribute of session in a jSP page,
>>>> which I
>>>> had set in an action by using logic:present and bean:out tagas, but I
>>>> coulnd't. It seems like those are not a right tag.
>>>>
>>>>
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/How-can-I-access-an-attribute-of-session-using-JSP-tags--tf3797537.html#a10741921
>>>>
>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> -- 
> View this message in context: 
> http://www.nabble.com/How-can-I-access-an-attribute-of-session-using-JSP-tags--tf3797537.html#a10742891
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


Re: [S1] Really simple newbie question

Posted by Dave Newton <ne...@yahoo.com>.
--- "Braun, James F" <BR...@polaroid.com> wrote:
> However, when trying to create a simple test app to
> verify the installation I get the following error
> 
> javax.servlet.jsp.JspException: Exception creating
> bean of class test.form.TestForm: {1}
> [... stack trace ...]
> I hate to waste people's time but does anyone have a
> suggestion?

You might need to supply either the bean's XML
definition or some code, and the JSP fragment
containing the <html:form.../>

d.



      ____________________________________________________________________________________Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 


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


[S1] Really simple newbie question

Posted by "Braun, James F" <BR...@polaroid.com>.
I set up a new work station with MyEclipse 5.1, Weblogic 8, and jdk
1.4.11

I set it up exactly the same as a workstation that is working well. 

However, when trying to create a simple test app to verify the
installation I get the following error

javax.servlet.jsp.JspException: Exception creating bean of class
test.form.TestForm: {1}
	at
org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:487)
	at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)
	at jsp_servlet._form.__test._jspService(__test.java:151)
	at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
	at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Se
rvletStubImpl.java:1077)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:465)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:348)
	at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r
un(WebAppServletContext.java:7047)
	at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSu
bject.java:321)
	at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121
)
	at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
etContext.java:3902)
	at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
java:2773)
	at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
	at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

I have looked at this until my eyes are blurry and googled the error
message but have no clues.

I hate to waste people's time but does anyone have a suggestion?

Thanks, J.

J. Braun
Polaroid Corp.
Waltham MA USA
+1 781.386.6871
+1 781.424.1159 mobile
braunj@polaroid.com
 
Excellence through execution.
 

-- 
This transmission is intended only for use by the addressee(s) named herein and may contain information that is proprietary, confidential and/or legally privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you.



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


Re: How can I access an attribute of session using JSP tags?

Posted by Nuwan Chandrasoma <my...@gmail.com>.
Hi,

Add to what i said, equal tag only check values which are double,long or 
string only.

Thanks,

Nuwan


----- Original Message ----- 
From: "hk" <hy...@yahoo.com>
To: <us...@struts.apache.org>
Sent: Tuesday, May 22, 2007 5:30 PM
Subject: Re: How can I access an attribute of session using JSP tags?


>
> In my JSP page, I have a code like below,
>
>  <logic:present name="netblockflixter.Login" scope="session">
>    <logic:equal value="Boolean.TRUE" property="netblockflixter.Login"
> scope="session">
>            Logout
>    </logic:equal>
>  <logic:notEqual value="Boolean.TRUE" property="netblockflixter.Login"
> scope="session">
>            Login
>   </logic:notEqual>
>  </logic:present>
>
> I think, logic:present tag can check the session bean, but in this case, 
> the
> "netblockflixter" is not a bean.
> How can I check the attribute in struts tag?
>
>
>
> Lance Semmens-3 wrote:
>>
>> I am saying the standard struts tags do check session scope if
>> scope="session" or no scope is provided, so it's probably a bug in your
>> code.
>>
>> Nuwan Chandrasoma wrote:
>>> Hi,
>>>
>>> I would go for JSTL tags, but i dont really get what you trying to say!
>>>
>>> Thanks,
>>>
>>> Nuwan
>>>
>>> ----- Original Message ----- From: "hk" <hy...@yahoo.com>
>>> To: <us...@struts.apache.org>
>>> Sent: Tuesday, May 22, 2007 4:37 PM
>>> Subject: How can I access an attribute of session using JSP tags?
>>>
>>>
>>>>
>>>> I tried to check and output an attribute of session in a jSP page,
>>>> which I
>>>> had set in an action by using logic:present and bean:out tagas, but I
>>>> coulnd't. It seems like those are not a right tag.
>>>>
>>>>
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/How-can-I-access-an-attribute-of-session-using-JSP-tags--tf3797537.html#a10741921
>>>>
>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> -- 
> View this message in context: 
> http://www.nabble.com/How-can-I-access-an-attribute-of-session-using-JSP-tags--tf3797537.html#a10742891
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


Re: How can I access an attribute of session using JSP tags?

Posted by hk <hy...@yahoo.com>.
In my JSP page, I have a code like below,

  <logic:present name="netblockflixter.Login" scope="session">
    <logic:equal value="Boolean.TRUE" property="netblockflixter.Login"
scope="session">
            Logout
    </logic:equal>
  <logic:notEqual value="Boolean.TRUE" property="netblockflixter.Login"
scope="session">
            Login
   </logic:notEqual>
  </logic:present>

I think, logic:present tag can check the session bean, but in this case, the
"netblockflixter" is not a bean.
How can I check the attribute in struts tag?



Lance Semmens-3 wrote:
> 
> I am saying the standard struts tags do check session scope if 
> scope="session" or no scope is provided, so it's probably a bug in your 
> code.
> 
> Nuwan Chandrasoma wrote:
>> Hi,
>>
>> I would go for JSTL tags, but i dont really get what you trying to say!
>>
>> Thanks,
>>
>> Nuwan
>>
>> ----- Original Message ----- From: "hk" <hy...@yahoo.com>
>> To: <us...@struts.apache.org>
>> Sent: Tuesday, May 22, 2007 4:37 PM
>> Subject: How can I access an attribute of session using JSP tags?
>>
>>
>>>
>>> I tried to check and output an attribute of session in a jSP page, 
>>> which I
>>> had set in an action by using logic:present and bean:out tagas, but I
>>> coulnd't. It seems like those are not a right tag.
>>>
>>>
>>> -- 
>>> View this message in context: 
>>> http://www.nabble.com/How-can-I-access-an-attribute-of-session-using-JSP-tags--tf3797537.html#a10741921 
>>>
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-can-I-access-an-attribute-of-session-using-JSP-tags--tf3797537.html#a10742891
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: How can I access an attribute of session using JSP tags?

Posted by Lance <la...@marketpipe.com>.
I am saying the standard struts tags do check session scope if 
scope="session" or no scope is provided, so it's probably a bug in your 
code.

Nuwan Chandrasoma wrote:
> Hi,
>
> I would go for JSTL tags, but i dont really get what you trying to say!
>
> Thanks,
>
> Nuwan
>
> ----- Original Message ----- From: "hk" <hy...@yahoo.com>
> To: <us...@struts.apache.org>
> Sent: Tuesday, May 22, 2007 4:37 PM
> Subject: How can I access an attribute of session using JSP tags?
>
>
>>
>> I tried to check and output an attribute of session in a jSP page, 
>> which I
>> had set in an action by using logic:present and bean:out tagas, but I
>> coulnd't. It seems like those are not a right tag.
>>
>>
>> -- 
>> View this message in context: 
>> http://www.nabble.com/How-can-I-access-an-attribute-of-session-using-JSP-tags--tf3797537.html#a10741921 
>>
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


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


Re: How can I access an attribute of session using JSP tags?

Posted by Nuwan Chandrasoma <my...@gmail.com>.
Hi,

I would go for JSTL tags, but i dont really get what you trying to say!

Thanks,

Nuwan

----- Original Message ----- 
From: "hk" <hy...@yahoo.com>
To: <us...@struts.apache.org>
Sent: Tuesday, May 22, 2007 4:37 PM
Subject: How can I access an attribute of session using JSP tags?


>
> I tried to check and output an attribute of session in a jSP page, which I
> had set in an action by using logic:present and bean:out tagas, but I
> coulnd't. It seems like those are not a right tag.
>
>
> -- 
> View this message in context: 
> http://www.nabble.com/How-can-I-access-an-attribute-of-session-using-JSP-tags--tf3797537.html#a10741921
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


Re: How can I access an attribute of session using JSP tags?

Posted by Lance <la...@marketpipe.com>.
It should be ok, if you leave the scope attribute empty, all scopes will 
be checked.
If scope="session" the tags will only check session scope.

Can I also suggest checking jstl which may make things (esp logic) a lot 
easier
http://jadecove.com/downloads/jstl-quick-reference.pdf

hk wrote:
> I tried to check and output an attribute of session in a jSP page, which I
> had set in an action by using logic:present and bean:out tagas, but I
> coulnd't. It seems like those are not a right tag.
>
>
>   


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