aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes cset problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "cset problem" Watch "cset problem" New topic
Author

cset problem

Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402
Hi all,

I wrote simple code to test the <c:test>

here is the full code

Employee.java



ServletClass.java



jsp




I think there is no
empA
attribute in the session (because we set it to request). So [B]c:set[B] creates new object.

the created object has not property called name or id,

so there should be no out put.

but the out put was

Name: Chaminda
Id: 1

can some body explain this?

Regards,
Chminda
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364

<c:set var="empB" scope="session" value="${empA}" />

I think there is no empA attribute in the session (because we set it to request). So [B]c:set[B] creates new object.


THe scope in <c:set> is about the variable being set (var="empB") and not about the value (value="${empA}").
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402
Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cset problem
 
Similar Threads
JSTL Question -Marcus Green
JSTL: remove object from scope
NullPointerException in SimpleTag
Help with this code!
how to use scope in target version of c:set