• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

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
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!