Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS 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
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

some basic queries regarding value stack in struts 2?

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am new to strut 2 though I have worked on struts 1.2.In one of the pexisting project jsp file I have following code:

Request is coming CustomerRelationAction.java which has method getCustomerRelations() and getRelationId().

here are the questions :-
1.
I put breakpoint inside method getCustomerRelations().i see flow is coming four time inside this method. Two times at line 3 and another two times at line 4. As per my understanding flow should come only 1 time i.e at line 3. Once it completes getCustomerRelations at line 3 , should not put its value in value stack so that it can refer to it nextime it is refered (like it is being reffered at line 14 again)?

2.
getCustomerRelations() method returns the list of CustomerRelationData objects where CustomerRelationData class also contains the getRelationId() method.Now at line 5 we are refering value="relationId at line 5. On Which object(CustomerRelationAction.java or CustomerRelationData), getRelationId() method will be called? even i am not sure will the list object CustomerRelationData will be present on value stack or not?If yes at which line it will be put in value stack?

3.
Now the iterator completes at line 6.After that,now i refer the code <s:property value="relationId" /> again, On Which object(CustomerRelationAction.java or CustomerRelationData), getRelationId() method will be called?


posted at http://stackoverflow.com/questions/8930873/some-basic-queries-regarding-value-stack-in-struts-2 too but did not get any reply as of now.
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To see the data in the value stack put your project development environment and use the tag in the jsp
 
scott miles
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mohan Rao Sv wrote:To see the data in the value stack put your project development environment and use the tag in the jsp



Thanks for giving valuable information. But as soon as i do the above settings i see below error on web page




Do i need to do some other other setting too for this? i am putting <s:debug /> tag after var relationshipData got evaluated i.e after }(see below line 6)
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put this tag in form <s:debug/> or

http://localhost:8080/customersupport/yourAction.action?debug=xml

This will print the all the data in the valueStack.
 
Fire me boy! Cool, soothing, shameless self promotion:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic