struts

What are some examples of the validate() and reset() methods in Struts 2?

cam any one give me the example of validate() and reset() methods in struts2 ...

Struts LookUpDispatchAction redirect

Hi all, We are migrating our web applications which use struts 1.2 and running on Weblogic 8.1 to Weblogic 10.3. Some action classes in our applications extend LookUpDispatchAction class. For these action classes if the redirect attribute in 'struts-config.xml' is set to true they are giving problem in Weblogic 10. I understood that ...

Simple MVC question for J2EE Web Applications?

One of the goals of the MVC approach to web development is to separate out the model, view, controller. Lets say in a J2EE Struts like environment, you associate the Struts Action with the controller, a Java bean with the model, and JSP and/or ActionForm with the View. My question, where do you tend to perform any logic to populate dat...

Perform task in JSP using a Hashmap lookup

I have a Hashmap and a set of keys. For each key, I want to perform a task depending on whether or not it is present in the hashmap. Can someone show be a way to do this? I'm using Struts and JSPs in my application ...

How to suppress client-side validation when field in bind to dojo's ajax call

Using Struts 2 and Dojo Given a Form with validate="true" for client-side validation, I have a form textfield that is bind to an Ajax action. When the field is changed the Ajax call should be executed (achieved by events="onkeyup"). Only the bound field is added to the Ajax call (using formFilter attribute). But, the validation is exec...

How to prevent XSS vulnerability with Struts

Hello, We need to add anti-XSS support in our Struts application. Most specifically the architect requires that all user input must be "sanitized" before storing in DB. As I don't want to reinvent the square wheel, which Java library can I use for this ? And where to put it ? Ideally it should be configurable (which input fields to che...

Prevent Form spam with the session

Hello, I've already read most of the questions regarding techniques to prevent form spam, but none of them seem to suggest the use of the browser's session. We have a form that sends an email to given email address and we didn't like the idea of using "captchas" or Javascript, as we wanted to keep the user journey simple and accessible...

Learning Path: Struts1 -> (Struts2 or Spring)

After having read and used (made a web application using Struts/Hibernate last semester) Struts1, I want to step forward in learning a better MVC framework. I have been wondering if it would be more prudent to learn Struts2 now and Spring later, or skip Struts2 for Spring directly? ...

Make Struts show different JSPs for different roles

We have a Struts 2 web application that's used by pretty much every employee to manage and configure jobs for our server farm. We're working on a plan to make a dashboard for customers, so they can see their own jobs, and a very simple display of its status ("in process", "ready for proofing", "finished", etc). All of the pages the cus...

is struts a good starting point for java web

I've been developing in java then I stopped, so now since I have my google app engine account I wanted to start with this again. Also I love web and I know struts is a good MVC framework. I've been reading this. do you think struts can help me to start or should I start with "plain" servlets, and then go to some framework ...

Setting global variable in Struts with Spring

What is the best approach to set servlet context variable in Struts? This variable is displayed on every single page in header tile and has to be loaded from DB. For that purpose there is Hibernate DAO and Spring Service which returns the requested value. My current approach was to extend Struts PlugIn class and inject my service into i...

Java Struts 1: forward from action to action. Passing data through ActionForms

Hi, We've been trying to redirect from one action to another, hoping that data would pass itself from ActionForm to ActionForm. Basically, we have to actions. The first action receives a request from the browser, prints some data field, and forwards it to another action, that prints the same fiend and redirects to a jsp. The thing is th...

Best way to show the user full name in a JSP header file with a spring/struts framework?

I have a JSP struts application that uses Spring to integrate with the services/dao/database. Basically, struts uses spring to get the data from the DB, it builds the form and forward them to the JSP files. I have a header file that is injected in each JSP file using Tiles. I would like to show "Welcome John Doe" on each page inside th...

moving a website built on struts to a CMS

Hi. Imagine having developed a classical website with java&struts. Now you customer is learning that redeploying the application to change an image or a text is a significant cost. And it asks to add a function to the site: cms-like handling of the contents (editing, versioning, approved publishing). How would you handle this request? ...

Get current filename in JSP

Is there a way to get which JSP is currently rendered, with JSTL or Struts (or without)? like _ _ file _ _ in Python and PHP? ...

Is Struts 2 available as an OSGi bundle?

I have a server application that consists of multiple OSGi bundles, some mine, some third-party. One of the bundles provides a web frontend using Struts. The necessary Struts libraries live inside the web front-end bundle. Now I want to add a second bundle that provides another web front-end, with different dependencies and a very diffe...

How to display Excel content from Struts portlet on Websphere Portal

Here is the code, it don't display the .csv file: public class ForwardAction extends MultiAction { private static final String FILE_ERROR = "<h3><center>INVALID FILE</center></h3>"; public ActionForward doVizualizare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exceptio...

LazyInitializationException with session scoped bean

I'm getting LazyInitializationException with session scoped bean in my service layer. If I load the same bean using a regular dao in my method, I can access it's lazy collections without problems. But if I inject it in my service bean, and then try to access one of its lazy collection, I have a LazyInitializationException. I'm using J...

How to fetch hibernate query result as associative array of list or hashmap

I am developing an application in struts 2 hibernate 3. I have 3 tables Inspection InspectionMission Timeline Inspection is associated with InspectionMission and InspectionMission is associated with Timeline. Now I have following problem. I have written following query in HQL public List getQuartewiseInspectionList(){ Session ses...

Java Struts list listKey listValue listClass?

Well new to the java stuff and having trouble with assigning a class attribute to this SELECT options. wanted to know if the listClass is correct? What I'm trying to accomplish is to add a class attribute to the options of a SELECT drop down What I have: <select> <option value="volvo">Volvo</option> <option value="saab">Saab</optio...