This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

scitping variables

 
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right now, in my JSP, teh Java scriptlet is like this

Now, my question is can we replace the aboev code with Strut tags..
I tried with bean efine .. ect to define a variable of tyep Vector .. But it is nt wotking..i am a bit confused abt the attributes. Can someon ehelp me on this.
thanks
 
manasa teja
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any please help me on this...
 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heres how to do it with jstl and struts:
<%Vector resultVector = new Vector();resultVector= (Vector)(session.getAttribute("resultVectorfrmAction")); // get teh resultvector from session object.pageContext.setAttribute("resultVector",resultVector,PageContext.PAGE_SCOPE);%>
//get a variable out of the form which is in the session scope
<c:set var = "resultVector1">
<bean:write property="resultVectorfrmAction" name="BeanName"/>
</c:set>
//set it in the page context scope which is the default scope
<c:set var="resultVector" value="${resultVector1}"/>
HTH
Sahil
 
manasa teja
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by desi dude:
Heres how to do it with jstl and struts:

//get a variable out of the form which is in the session scope
<c:set var = "resultVector1">
<bean:write property="resultVectorfrmAction" name="BeanName"/>
</c:set>
//set it in the page context scope which is the default scope
<c:set var="resultVector" value="${resultVector1}"/>
HTH
Sahil


Thanks man.. Do I need to import any thing or somthinglike that to use teh above code.. anyhow, i will give it a try and see
 
This guy is skipping without a rope. At least, that's what this tiny ad said:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic