Archive | Struts
get session into action class in struts 2.x
JSPs contain implicit session object to use in the jsp pages, when an action in invoked in struts we need to get ‘session ‘ into the action class, we can do this by implementing “SessionAware” interface. Eclipse will ask you to implement an unimplemented method click on that meesage and eclipse will create the method for you called “public void setSession(Map<String, Object> arg0){//TODO}”
Hello World program in Struts 2.0
| Hello World Application
Here we will see how to create a simpe Struts 2 Hello World Application. The following files are needed to create a Hello World Application.
|
Using JavaScript to submit a form in Struts
You can submit a form with a link as below. the examples below assume you are in an <html:form> block and ‘myForm’ is picked up from the struts-config.xml name field of the action.
<a href=’javascript:void(document.forms["myForm"].submit()>My Link</a>
Now the trick in the action is to decode what action you intend to perform. Since you are using JavaScript, you could set a field value and look for it in the request or in the form.
Yep.... I couldn't have said it better myself......
Yep.... I couldn't have said it better myself......
Yahoo results... While searching Yahoo I found this page in the results and I didn't think
Nice Focus.... I really like the direction you've decided to take this blog....