• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Closing the window and identifying multiple buttons

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to Struts and I am a writing a small application for Online Test in struts 2.0. I have got three queries:

1. After successfully login into the application, if the user presses the Close button (X) on the window and then the user starts the application again, will the previous session be retained. If so, what is way to invalidate the session after the Close button is pressed so that all the variables scoped at session level are set to their initial value.

2. In my test.jsp, I have got two buttons - prev and next. In my corresponding action class method, I want to identify which of the two buttons was pressed so that counter can either be decremented or incremented depending on the button pressed.
i wrote the following code but nextprev does not seem to retain the value of the button pressed. Result of this is null is passed to the action property nextprev.


3. How do we scope classes at various levels in struts 2.0 i.e Request, Session, Page, Application.

please help. thanks in advance.



 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's no trivial way for the server to know a window was closed: HTTP is a stateless protocol. The browser makes a request, as far as the server is concerned the browser no longer exists until it makes another request. There are ways to cope with this using JavaScript, but that's not directly Struts-related.

I'm not sure what you're asking in the last question. Are you asking how to use the request and session scopes?
 
garima jain
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. Yes I want to know how to use them. I need answer for my second question as well.

Please help.
garima
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic