Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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
 
machines help you to do more, but experience less. Experience this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic