struts2

Struts- Best way to connect to Mysql in struts 2?

Unable to determine what is the best way to connect to mysql database in struts.. We can always use DriverManger and Class.forName() to connect. DataSource interface - but this has problems I am getting compliation error for DataSource dataSource = (DataSource)context.getAttribute(Globals.DATA_SOURCE_KEY); or when Action.Data_SOURCE_K...

How is a "Context Object" design pattern used to enhance security?

I'm familiar with the use of the context object design pattern - a lightweight context wrapper around objects passed between tiers. If one were to use the context object to track taint (untrusted user input), or the origin tier, I could see how a receiving tier could dynamically filter, encode, or validate accordingly. For example: A ...

How to do background tasks in struts2?

Hi, i had a look on the struts plugins list here and wasn't able to find a plugin to do background/scheduled tasks. What i want to do, is run a daily task that pulls files from a few servers. I'd like this task to be run from within the web app, so that my importer gets access to all the data classes, also it would be less complicated I...

String[] vs Integer[] in Struts2 action attribute

I am new t struts2. i built one page, that shows list of employees. I can seach the employes based on his name by applying filter criteria and click on find button. At the same time, i provided check box in the left side for each employee name for delete operation. for all checkboxes, i gave Integer[] attribute name which is declared in ...

At a high level, how does struts2 work? I'm coming from a mvc background

At a high level, how does struts2 work? I'm coming from a mvc background Looking at a sample project, I see allot of these ___action type classes. Is it just a action references to a controller action? i.e. a response to a particular url based on get/post? ...

struts2 autocomplete

Hi, I want to create a drop down menu with autocomplete feature. I have a role object with properties roleId, roleDescription. My search box should only autocomplete on roleDescription. I followed this example: http://code.google.com/p/struts2-jquery/wiki/AutocompleterTag autocompleter-select.jsp <sj:autocompleter ...

JSP unable to find Struts2 action

Hi All, I use resin 3.0.25 web server for my application. Earlier application's context path was "/myApp". But now I have deployed it as ROOT, So I changed the context path to "". I have an index.jsp which is the welcome page of the application and it does nothing except for redirecting to my struts 2 action. When the context p...

Unable to apply DWR Ajax feature to the jsp page in struts2 application

Hi I am trying to apply ajax DWR to my form feilds in struts2 .. I have made the changes in the application .. 1) Added the library struts2-dwr-plugin-2.1.6.jar in the Lib folder. 2) Added the following Servlet mapping in the web.xml . <servlet> <servlet-name>dwr</servlet-name> ...

how to apply theme as ajax to the jsp form with struts2-core-2.1.6.jar used struts 2 application ?

Hi I am trying to implement ajax to my struts2 application using the DWR . while configuring DWR i need to make the theme of the form as ajax . I am using struts2-core2.1.6.jar in which it did not have the ajax theme at all , the template folder has the css_xhtml,simple,xhtml and archive themes I have made all the congfigurations for th...

What's the Struts 2 equivalent of ASP.NET's Request.Form (or FormCollection)?

I'm dynamically adding textboxes to a form on my jsp page using Javascript. When that form is submitted to an action, how does my action get the values of those textboxes? (I'm using Struts 2, btw.) In ASP.NET, I was able to find them in Form.Request/FormCollection. Is there a Struts 2 equivalent? Thanks a million. ...

Struts2 input values lost when calling interceptor

Hi, i have a problem with Struts2 This is my action configuration, before executing the roleDete in the Action, the interceptor is call, but after this, the values of the input are lost, there is no id to delete, if i remove the interceptor then the id to delete exist, could some one guide me to solve this? <action name="roleDelete" m...

When using quartz scheduler in a java web app (struts2), where do i configure the jobs?

Hi all, I'm trying to integrate quartz scheduler into a struts2 web app. Just wondering where you configure the jobs? I think the best place would be to put their details in the quartz.properties, but i cannot find the documentation that shows how to do this. All i can find is examples of how to programmatically create the jobs, but if...

how will the checkbox's in the struts2 tag checkboxlist should appear in column wise not in row wise ?

how can i arrange the checkbox's in the struts2 tag checkboxlist in the form of table to display it in the column wise , so that i can hide the borders n view it in column wise list="communityList" value="defaultSelect" /> ...

how to maintain the list of bean(domain objects) value in Struts2 as hidden attribute

In STruts, i am trying to hold the Lst value in hidden.This lst value should be available untill the user clicks on clear button.When user clicks on find, seach conditions options get added into this list. how do i have to implement this.?For me what happening is that, List object is added as another List..[[[]]] as result..my code is, ...

how to set value of valueNotifyTopics by javascript

Hi everybody, I'm having a trouble with dojo and really need your help. I want to catch changedValue event of datetimePicker controls in my pages (which haven't had valueNotifyTopics attribute yet). So, in dojo.addOnLoad function, I use setValueNotifyTopics to set value of valueNotifyTopics on it. But I don't know why setValueNotifyTopic...

how do i call the action name from the web.xml instead of typing the action name at the url of the browser

In My struts2 application i have a struts2 tag checkboxlist something like this <s:checkboxlist name="yourSelect" label="Are You Inteterested In" list="communityList" value="defaultSelect" /> i added the list elements in my action class constuctor view plaincopy to clipboardprint? public CustomerAction() { ...

want to add a subgrid in struts2 jquery grid

I have two grids department and student. Now I want to show department grid always and whenever any row of that department grid is selected student grid will open at the bottom of the department grid with all the student data of that department. Can you help me on this. I am using struts2 and jQuery. Thanks in advance. ...

struts2 double submit problem

Hi all, I am using struts2.1.8. Here I want to handle double submission. truts2 provides TokenInterceptor. So if I submitted two times, it returns "invalid.token" as a result name. But I want to display the same page from which I have submitted twice. ...

Error implementing Jasypt with Hibernate 3 and Struts 2

Hi, I'm trying to encrypt passwords in a webapp using Jasypt with hibernate 3. I followed the instructions on the jasypt website. Here's my hibernate mapping : <hibernate-mapping package="webapp.entity"> <typedef name="encrypted" class="org.jasypt.hibernate.type.EncryptedStringType"> <param name="encryptorRegisteredName">strongH...

How does a Struts2 action compare to a Servlet?

How do Struts2 actions compare to Servlets? Can an action act as a servlet? ...