Search Results

Search found 245 results on 10 pages for 'struts2'.

Page 7/10 | < Previous Page | 3 4 5 6 7 8 9 10  | Next Page >

  • Reload Grid not working for mutiple jqgrid

    - by arun chaudhary
    I am using jqgrid.My page has three tabs and each tab contains a different grid.All grids have different ids.The content of tabs is fetched via AJAX request lazily.Now after all three grids are rendered and i try to reload grid via function jQuery("#myOffersTable").trigger('reloadGrid'); Only the grid which loaded last reloads and it doesn't work for other grids. eg if grids load seq is : 1-2-3 then this code will only work for grid 3 but if seq is 3-2-1 then it will work only for 1. But if i try reloading grids using reload button on navigator bar it works fine. Any help would be appreciated. Thanks Arun

    Read the article

  • Struts 2- problem with s:action tag

    - by Raghave
    Here is a small test application that does following things ask user to enter his name and submit - (index.jsp) as a result of index.jsp is the welcome.jsp page that asks user to select his/her blood group index.jsp <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> <form action="MyName"> <s:textfield name="UserName" label="Enter Your Name"/> <s:submit/> </form><br> </body> </html> struts.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <package name="module1" namespace="" extends="struts-default"> <action name="MyName" class="module1.User"> <result>/Welcome.jsp</result> </action> <action name="Blood_Group" class="module1.SelectBloodGroup" method="bloodGroupList"/> </package> </struts> SelectBloodGroup.java package module1; import java.util.ArrayList; import com.opensymphony.xwork2.ActionSupport; public class SelectBloodGroup extends ActionSupport{ private ArrayList<BloodGroup> bglist; public String bloodGroupList(){ bglist = new ArrayList<BloodGroup>(); bglist.add(new BloodGroup("1","A+")); bglist.add(new BloodGroup("2","B+")); bglist.add(new BloodGroup("3","AB+")); bglist.add(new BloodGroup("4","O+")); bglist.add(new BloodGroup("5","A-")); bglist.add(new BloodGroup("6","B-")); bglist.add(new BloodGroup("7","AB-")); bglist.add(new BloodGroup("8","O-")); return "SUCCESS"; } public ArrayList<BloodGroup> getBglist(){ return bglist; } } class BloodGroup{ private String id; private String bg; BloodGroup(String id,String bg){ this.id=id; this.bg=bg; } } welcome.jsp <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> <s:action name="Blood_Group" executeResult="false"/> //***************here is the problem*************** <s:select list="bglist" listKey="id" listValue="bg"/> //*********************************************** </body> </html> Struts is unable to identify bglist as a collection or Array or List or iterator. WHAT SHOULD I ASSIGN TO list ATTRIBUTE IN THE s:select TAG IN THE FILE welcome.jsp What is wrong with the code please tell me in detail. If you could send me the correted version. WHY IS THE s:action Tag not working ? This is the error i am getting Apr 13, 2010 1:49:19 PM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception tag 'select', field 'list': The requested list key 'bglist' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]

    Read the article

  • Wizard form in Struts

    - by Kuntal Basu
    I am creating a wizard in Struts. It cotains 4 steps. For Each step I have separate ActionClass say:- Step1Action.java Step2Action.java Step3Action.java Step4Action.java and in each class there are 2 methods input() and process(). input() method is for showing the page in input mode process() method is will be use for processing the submitted data (if validation is ok) I am carrying all data upto the last step in a session. And saving all of them in database in the last step Similaly 4 action tags in struts.xml like :- <action name="step1" class="com.mycomp.myapp.action.Step1Action1" method="input"> <result name="success" type="redirectAction">step2</result> <result name="input">/view/step1.jsp</result> </action> <action name="step2" class="com.mycomp.myapp.action.Step1Action2" method="input"> <result name="success" type="redirectAction">step3</result> <result name="input">/view/step2.jsp</result> </action> But I think I am going wrong. Please Tell me How will I handle This case?

    Read the article

  • Tags usage in Struts 2

    - by Panther24
    Hi, I have the following code snippet <s:iterator status="stat" value="masterAccountList"> <tr> <td><s:property value="name"/></td> <td><s:property value="status"/></td> <s:set name="DrStat" id="DrStat" value="<s:property value='status'/>"/> <td><s:if test='DrStat.contains("Out")'> Dr. Is Available </s:if> <s:else> Dr. Is not Available </s:else> </td> </tr> </s:iterator> I need to check the status if it contains a keyword and display text accordingly. When I try this, I always get 'Not Available' status. I'm not even sure what the set returns, how can I see that?

    Read the article

  • Redirect to another action in an interceptor in struts 2

    - by user292662
    I am currently in the process of learning Struts 2 and I am currently building a simple application where unverified users are redirected to a login form. I have a login form and action functional which takes the users credentials, verifies them and stores a User object in the session however I am now trying to prevent access to pages before the login has taken place and I am trying to do this with an interceptor. My problem is that I have written an interceptor that checks whether the User object has been saved in the session but if it has not I want to redirect to the login page and can't find any way of doing this without bypassing struts and using the HttpServletResponse.sendRedirect method Configuration: <package name="mypackage" extends="struts-default" namespace="/admin"> <interceptors> <interceptor name="login" class="my.LoginInterceptor" /> </interceptors> <default-interceptor-ref name="login"/> <action name="login" class="my.LoginAction"> <result name="input">/admin/login.jsp</result> <result name="success" type="redirect">/admin</result> </action> <action name="private" class="my.PrivateAction"> <result>/admin/private.jsp</result> </action> </package> The interceptor code: @Override public String intercept(ActionInvocation inv) throws Exception { Map<String, Object> session = inv.getInvocationContext().getSession(); Object user = session.get("user"); if(user == null) { // redirect to the 'login' action here } else { return inv.invoke(); } }

    Read the article

  • struts 2 - where should I set global application variables?

    - by Nicola Montecchio
    Hi I'm using struts 2 and I'd like to read some custom-defined parameters (global variables), preferably from web.xml or some custom ".properties" file (i.e. not hardcoded in the Java sources). This problem has been driving me mad for the past half hour as I can't google any reasonable solution. What is the best way to do this? I find it strange that it is so difficult ... all the best Nicola Montecchio

    Read the article

  • How to test a struts 2.1.x developer?

    - by Jason Pyeron
    We employ test to filter out those who can't. The tests are designed to be very low effort for those who can and too much effort for those who can't. Here is an example for java web application developer on an Oracle project: We only work with contractors who can use the tools we use, to determine if you can use the tools we have devised some very simple tests. Instructions If you are prepared and knowledgeable this will take you about 2-5 minutes. Suggested knowledge and tools: * subversion 1.6 see http://subversion.tigris.org/ or http://cygwin.com/setup.exe * java 1.6 see http://java.sun.com/javase/downloads/index.jsp * oracle >=10g see http://www.oracle.com/technology/software/products/jdev/index.html * j2ee server see http://tomcat.apache.org/download-55.cgi or http://www.jboss.org/jbossas/downloads/ Steps 1. check out svn://statics32.pdinc.us/home/subversion/guest 2. deploy the war file found at trunk/test.war 3. browse to the web application you installed from the war file and answer the one SQL question: How many rows are in the table 'testdata' where column 'value' ends with either an 'A' or an 'a'? The login credentials are in trunk/doc/oracle.txt 4. make a RESULTS HASH by submitting your answer to the form. 5. create a file in tmp/YourUserName.txt and put the RESULTS HASH in it, not the answer. 6. check in your file (don't forget to add the file first). 7. message me with the revision number of your check in. As such I am looking for ideas on how to test for someone to be a struts 2.1 w/ annotations.

    Read the article

  • Redirect to default action in Struts 2

    - by topher-j
    I have an action with an empty string for name defined in the root namespace, and I want to redirect to that action from another action if a certain result is found, but it doesn't seem to work. Here's the default action <action name="" class="com.example.actions.HomeAction"> <result name="success" type="freemarker">freemarker/home.ftl</result> </action> And I'm defining the redirect in the global-results for the package: <global-results> <result name="sendToRouting" type="redirectAction"> <param name="actionName"></param> <param name="namespace">/</param> </result> </global-results> I've tried taking out the actionName parameter, but that doesn't work. If I put a name in for the HomeAction and reference it by name in the global-results it works, so I'm assuming the problem is lack of action name for the redirect. Any thoughts?

    Read the article

  • pass Multilple paramets in struts action with same parameter name

    - by raju
    Hi I would like to pass Multiple parameters for single param in action tag. Ex: abc Answers.jsp I have getters and setters for hint (String) variable in my action. Currently i can be able to get parameter value for hint variable as abc if i send one. I would like to send multiple parameters for same variable(hint) ex: abc, xyz how can achieve the above. Thanks in advance Raju

    Read the article

  • Can I call sitemesh struts tags from a decorator in freemarker?

    - by fool4jesus
    I know if you are using JSPs, you can call struts tags defined the normal way from a decorator, like this: <html> <body> <decorator:body /> </body> </html> but in the examples I always see using freemarker decorators, they will instead say: <html> <body> ${body} </body> </html> Is this the only way to include the pieces of the page from the decorator, or is it possible to use the same taglibs? To test it, I put sitemesh-decorator.tld into WEB-INF/lib and tried just using <@decorator.body /> but no joy there. I think I'm missing something here, but I'm not sure what it is.

    Read the article

  • Annoying struts 2 problem

    - by Parhs
    Hello... I am using this code to include some menus to my code... <s:action namespace="/" name="get_header" executeResult="true" /> <jsp:include page="/get_menu" > <jsp:param name="menuKey" value="configuration"></jsp:param> <jsp:param name="subMenuKey" value="user.add"></jsp:param> </jsp:include> THe problem is that the menus are generated dynamically... So suppose that we have 2 Actions ActionA and get_menu Action The jsp page for the result of ActionA calls get_menu to generate the menus. So suppose that ActionA sets a variable groups and get_menu also uses a groups variable... ActionA's variable will overtake get_menu's variable. I tried many solutions and even jsp:inculde doesnt help:(...

    Read the article

  • Can an Aspect conditionally render parts of a JSP page ?

    - by Scott The Scot
    At present the jsp pages have normal authorize tags to conditionally render links and information etc. The website is on the intranet, and we're using Spring Security 2.0.4. Ive now got a business user who wants to allow all roles to access everything for the first few weeks, then gradually add the security back in as feedback is gathered from the business. Rather than go through every page, removing the authorize tags, only to have to put them back in, is is possible to configure these through an aspect, or is there any other way to externalize this into a config file ? I've found Spring's MethodSecurityInterceptor and the meta data tags, but these wouldn't give me the externalization. I've been on google for the last hour, and am now pretty sure this can't be done, but would love to find out I haven't been asking the right questions. Advice appreciated

    Read the article

  • Get status of servlet request before the response is returned

    - by Alex
    Good evening, I am in the process of writing a Java Servlet (Struts 2, Tomcat, JSP etc) which is capable of doing some fairly complex simulations. These can take up to 2 minutes to complete on the and will return a graph of the results. It is trivial to calculate the percentage of the simulation completed because the process works by repeating the same calculations 1000s of times. I would be interested to know if anyone has ever tried to use client side technology to provide any estimate of the percentage complete. I.e query the servlet processing to get the number of cycles completed at various point throughout the simulation. This could then be displayed as a bar in the client browser. Any thoughts, advice, resources would be much appreciated. Thanks, Alex

    Read the article

  • How to access struts interceptor parameters in Java?

    - by Ricardo
    I have the following code in struts.xml: <interceptor-ref name="checkTabsStack"> <param name="tabName">availability</param> </interceptor-ref> and I want to access the parameter tabName in the interceptor routine, how do i do that? i tried Map params = ActionContext.getContext().getParameters(); but params comes empty... Thanks!

    Read the article

  • What can I do about ambigous wildcard patterns in Struts?

    - by Hanno Fietz
    I have a problem finding the right wildcard pattern to extract parts of my URL into action parameters in Struts. This is how I set up the action. The intent of the pattern is to capture the last two path elements and then everything that might precede them. <action name="**/*/*" class="com.example.ObjectAction"> <param name="filter">{1}</param> <param name="type">{2}</param> <param name="id">{3}</param> </action> Calling it with the URL channels/123/transmissions/456 I get the following result (the action just sets the input parameters on a POJO and returns that as XML): <result> <filter>channels/123/transmissions</filter> <id/> <type>456</type> </result> It should be: <result> <filter>channels/123</filter> <id>456</id> <type>transmissions</type> </result> Now, because ** matches all characters including the slash, I guess my pattern allows more than one way to match the URL, and Struts happens to pick one that leaves the id empty. Is the behaviour for multiple possible matches defined somewhere? Can I make the pattern less ambigous? Are there alternative ways of doing this? I'm running Struts 2.0.8. Upgrading to 2.1.9 would give me regex matching, but I got into trouble with Struts' dependencies and my OSGi environment when I went past 2.0.8, so I'd like to stick to that version for now.

    Read the article

  • Struts 2 Select tag

    - by nathj07
    I'm pretty new to the jsp and struts way of doing things and so far I like what I see. My current question is with the use of the struts select tag. I have a page that displays a number of dropdown boxes using struts select currently the options are hard coded in the jsp. I would like to populate them based on a properties file. However I have no idea where to start. I assume I need to take the contents of a properties file into an Array (of some sort) and assign that to the select tag. My questions are: Where does the code t build the array go? How do I connect that array to the select tag?

    Read the article

  • Struts 2 how to display messages saved in a Interceptor which would redirec to another action?

    - by mui13
    in my interceptor, if user doesn't have enough right, there would be a warn message: public String intercept(ActionInvocation invocation) throws Exception { ActionContext actionContext = invocation.getInvocationContext(); Map<String, Object> sessionMap = actionContext.getSession(); User loginUser = (User) sessionMap.get("user"); Object action = invocation.getAction(); if (loginUser != null && loginUser.getRole().getId() != Constant.AUTHORITY_ADMIN) { ((ValidationAware) action).addFieldError("user.authority", ((DefaultAction) action).getText("user.action.authority.not.enough")); return DefaultAction.HOME_PAGE; } return invocation.invoke(); } then, it would redirect to "HOME_PAGE" action, if success, display information in the jsp. So how to display the warn message? i have used two interceptors configed in strust.xml, for admin right requirment: <interceptor-stack name="authorityStack"> <interceptor-ref name="authority" /> <interceptor-ref name="defaultStack" /> <interceptor-ref name="store"> <param name="operationMode">STORE</param> </interceptor-ref> </interceptor-stack> default is: <interceptor-stack name="default"> <interceptor-ref name="login" /> <interceptor-ref name="defaultStack" /> <interceptor-ref name="store"> <param name="operationMode">AUTOMATIC</param> </interceptor-ref> </interceptor-stack>

    Read the article

  • Using struts.xml with convention plugin

    - by David Alt
    This seems like it should be easy to do, but I just can make it work. I'm hooked on the convention plugin in Struts 2.1. However, I need to define some package-level configuration such as a new interceptor stack and exception mappings. I'd like to use the struts.xml file for this, but I can't get the convention-based packages matched to the struts.xml packages. My struts.xml looks like: <struts> <constant name="struts.convention.default.parent.package" value="default"/> <package name="default" extends="struts-default"> </package> <package name="root" namespace="/" extends="struts-default"> <action name="index"> <result>/index.jsp</result> </action> </package> <package name="my.package.actions.myaccount" namespace="/myaccount" extends="struts-default"> <interceptors> <interceptor name="authenticationInterceptor" class="my.package.interceptors.AuthenticationInterceptor"/> <interceptor-stack name="secureStack"> <interceptor-ref name="authenticationInterceptor"/> <interceptor-ref name="defaultStack"/> </interceptor-stack> </interceptors> <default-interceptor-ref name="secureStack"/> </package> </struts> I have my interceptor in: /src/my/package/interceptors and my actions in: /src/my/package/actions/myaccount

    Read the article

  • Trouble with client side validation using Struts 2. Xml based validation rules not recognized.

    - by Kartik
    Hi, This is my first post to ask a question on stack overflow and my issue is that when I don't see a client side validation error message when I don't enter any values for that field even when it is configured as required. The input page is reloaded but no error message is seen. I am not sure what I am doing wrong. Any advice would be greatly appreciated. My scenario is given below: I have a simple form where I have a pull down menu called selection criterion. A value must be selected. If a value is not selected, then the page should reload with configured error message. My input form action_item_search.jsp is given below: <%@ taglib prefix="s" uri="/struts-tags" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Action Item Search</title> </head> <body> <s:actionerror/> <s:fielderror /> <s:form action="action_item_search" validate="true"> <s:select label="Search Criterion" name="searchCriterion" list="#{'': 'Select One', 'creatorName':'creator name', assignedTo':'assigned to'}" required="true" /> <s:submit name="search" value="Search"></s:submit> </s:form> </body> I have add validators.xml in my WEB-INF/classes directory of exploded war file as given below: <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator Config 1.0//EN" "http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd"> ActionItemTrackingAction-findByCriteria-validation.xml is given below: <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> You must enter a search criterion. My struts mapping xml: <struts> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <constant name="struts.devMode" value="true" /> <!-- <include file="example.xml"/> --> <package name="action-item" extends="struts-default"> <action name = "action_item_search_input"> <result name = "success">/action-item-search.jsp</result> </action> <action name="action_item_search" class="gov.nasa.spacebook.ActionItemTrackingAction" method="fetchByCriteria"> <result name = "success">/action-item-result.jsp</result> <result name = "input">/action-item-search.jsp</result> <result name = "error">/action-item-search.jsp</result> </action> </package> My action class public class ActionItemTrackingAction extends ActionSupport { private List<ActionItem> actionItems; public List<ActionItemTracking> getActionItems() { return actionItems; } public void setActionItems(List<ActionItemTracking> actionItems) { this.actionItems = actionItems; } private String searchCriterion; public String getSearchCriterion() { return searchCriterion; } public void setSearchCriterion(final String criterion) { this.searchCriterion = criterion; } public String fetchByCriteria() throws Exception { final ActionItemTrackingService service = new ActionItemTrackingService(); this.actionItems = service.getByField(this.actionItem); return super.execute(); } }

    Read the article

  • How to inject param in Struts 2 Tag OGNL way

    - by Roy Chan
    Hi Guru, I want to use a property as a param of an object's method. <s:property value="orderProductId" /> returns correct value (e.g. 1) <s:iterator value="%{order.getProductById(1).activations}"> gives me correct value too. But <s:iterator value="%{order.getProductById(#orderProductId).activations}"> doesn't. Not sure why #orderProductId doesn't interpret correctly.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10  | Next Page >