I have 3 different jsps 1 for display, 1 for success and 1 for failure..
So Is there anyway I can use the <div tag in struts 2 and can have a single jsp and can make the others hide..
posted 7 years ago
you can use s:if tags to control if the style of each div is display:inline or display:none. The s:if tag can make its decision based on a property you set in your action class to indicate which div is to be displayed. If you do it this way I think you'll only have one result for your action in your struts.xml file.
If you'd rather have your struts.xml file control this then you can define 3 results and set a param for each result to indicate which div to display. I've only used params in my struts.xml file for redirectActions but I would think they should also work for JSPs. Your param should get set as an attribute in your request object. I don't thing its part of the OGNL stack for your jsp you'll either need to push the param on to your stack in the jsp or use OGNL to access your request attributes (and I haven't figured out how to get access to the request object through OGNL)