STRUTS-XML-MYSQL_INTEGRATION

Actually I have a jsp page that has 5 fields �Stock name ,Stock Symbol,Qty purchased,Price Purchased,Brokerage.
In the XML file , that will be given by Mr.X that will contain Stock Name , Stock Symbol , 52 week high , 52 week low, intra day high , intraday low , current price , closing price.
Now, we have to populate the XML contents into the database-MYSQL table .
Now that , we already have the above mentioned 5 values I.e. Stock name ,Stock Symbol,Qty purchased,Price Purchased,Brokerage in the database.
We have to check if the fields Stock Name and Stock Symbol we entered in the database though the jsp page and the XML file contents are matching.
If they both match then the remaining 3 values out of 5 values and other values of the XML i.e. , 52 week high , 52 week low, intra day high , intraday low , current price , closing price must be displayed along with the Stock Name and Stock Sybol that matched in both XML and the jsp page�s value that were submitted earlier into the database.
(1)we populate first into the database and from the database we compare with the values of the jsp pages that are dumped in the database
(2)if the values do not match then the errors must be sent as an email to our email id that we entered in login page which is actually present in teh database.
(3)through a DAO class , we write a query to insert the values and then enter them from the jsp page and click on submit
Once this is done , we need to do some calculations like current value=closing price * quantity purchased) � brokerage.
This is a Stock Application.
================
Now , we get an external XML that someone will provide..For that , we have to write a program such that , there is a provision to take that XML file and then dump into the database.
Now,the XML has all fields 52 week high , 52 week low, intra day high , intraday low , current price , closing price, Stock Name and Stock Sybol.
Theses two fields Stock Name and Stock Symbol present in the XML must be compared with the JSP stock name and stock symbol that we eneterd already in he database through the click submit of jsp page attached above.
If those two fields match , then we have to display the jsp page�s 5 fields and values + all the fields of the XML file in another jsp page.
If those 2 fields i.e. Stock Name and Stock Symbol , don�t match then a NOTIFICATION MAIL containing the errors must me sent to our MailID inbox.
NOTE: I have already dumped the Email Id into the database through the login jsp page.
My idea::::::::::::::: XML fields are mapped as database columns, can I use any XML parser to do this? If so how?Coz I am unaware of this entirely. ?

Jacob666666 wrote:
I don't understand the second reason, and Dreamweaver documentation does not cover it. I assume that this is not relevant to me.
You assume incorrectly. It's totally relevant to you.
http://localhost is the equivalent of htdocs. Since your site is in a subfolder of htdocs, you need to add the name of the subfolder to your URL prefix:
http://localhost/home/

Similar Messages

  • Parsing Error is struts xml files org.xml.s

    Hello ,
    I am getting a peculiar error while starting the Tomcat , the struts xml files are not being parsed correctly (they used to be before) .I get a parse error when I shut/start the tomcat (at each deployment) and hence due to the error the application fails (I guess ...)
    The errors I get on the log file while starting the tomcat are ...(only part of the error stack)
    parsing error processing resource path /WEB-INF/struts-action.xml
    org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    Servlet /ProteinBank threw load() exception
    javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-action.xml

    Have you changed your struts-config or web.xml files?
    Back it up, and try starting with a 'minimal' version of struts-config to see if it succeeds.

  • Apache Roller (or mayb Struts 2) problem on Tomcat 5.5.20 on Debian Etch

    Firstly I'm not at all sure whether this is the right forum for asking for help on this issue. People here have been very helpful in the past. If this post is in the wrong place, my apologies and please feel free to move it.
    I am trying to install Apache Roller 4.0 on a Debian Etch system that has the Apache Tomcat 5.5 package installed. I am using the Sun Java package as well. You might think the solution to this problem might be better sought in the Apache Roller community or the Debian community. However the problem I am experiencing is a far more general Java problem (I think).
    h1. Software versions
    java version "1.5.0_10"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
    Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)Tomcat 5.5.20 (Debian Etch package)
    Apache Roller 4.0
    h1. The error
    When I load up the application for the first time, following the Apacher Roller instructions for installation I get a bunch of IllegalAccessExceptions that AFAIK should not happen. An example is in the exception trail below.
    h2. Exception trail.
    ERROR 2007-12-30 11:31:25,476 StandardWrapperValve:invoke - Servlet.service() for servlet jsp threw exception
    Caught OgnlException while setting property 'location' on type 'org.apache.struts2.views.tiles.TilesResult'. - action - file:/vhost/beanlogic.co.uk/roller/WE
    B-INF/classes/struts.xml:129:77
            at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:199)
            at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:342)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
            at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
            at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
            at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
            at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
            at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
            at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
            at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
    //(there is a large stack trace here which probably not relevant so I cut it out. The caused by is next)
    Caused by: Caught OgnlException while setting property 'location' on type 'org.apache.struts2.views.tiles.TilesResult'. - Class: ognl.OgnlRuntime
    File: OgnlRuntime.java
    Method: invokeMethod
    Line: 508 - ognl/OgnlRuntime.java:508:-1
            at com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:367)
            at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
            at com.opensymphony.xwork2.ObjectFactory.buildResult(ObjectFactory.java:222)
            at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:195)
            ... 287 more
    Caused by: java.lang.IllegalAccessException: Method [public void org.apache.struts2.dispatcher.StrutsResultSupport.setLocation(java.lang.String)] cannot be a
    ccessed.
            at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:508)
            at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:812)
            at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)
            at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75)
            at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)
            at com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
            at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
            at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
            at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
            at ognl.SimpleNode.setValue(SimpleNode.java:246)
            at ognl.Ognl.setValue(Ognl.java:476)
            at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
            at com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
            ... 290 moreAny help would be great.
    Cheers
    Elwyn

    Have you resolved your problem? I am running into the SAME EXACT issues with my application. The only difference is I'm not deploying to webapps/ROOT/; I'm deploying to my own directory based on my WAR file name (webapps/<web_application_name>/WEB-INF....blah blah). If you figured out your problem (believe me, I wish I could be of some help) I would LOVE to hear what you did/figured out.
    -C

  • How is the Login-validation.xml file is called when we do the validation i

    Hi ^^,
    please forgive me if I am a big long while explaining.
    when you are using the struts 2.0 the web.xml has a welcome-file-list. I have put index.html in that list so it pulls up first.
    It has the following tag
    <ul>
              <li><a href="roseindia/showLoginClientSideValidation.action">Login Application (Client Side Validation)</a></li>
            </ul>so this maps to struts.xml which contains the showLoginClientSideValidation.action tag
    <action name="showLoginClientSideValidation">
                   <result>/pages/loginClientSideValidation.jsp</result>
            </action>
            <action name="doLoginClientSideValidation" class="net.roseindia.Login">
                <result  name="input">/pages/loginClientSideValidation.jsp</result>
                   <result  name="error">/pages/loginClientSideValidation.jsp</result>
                   <result>/pages/Loginsuccess.jsp</result>
            </action>
              this displays the jsp "loginClientSideValidation.jsp"
    once you enter the details in the jsp and click submit the control goes to Login.java file as per the mapping in struts.xml given above
    This is just a simple java file which contains the execute() method. This method returns success or error.
    If success is returned then the Loginsuccess.jsp is invoked
    If error is returned then the loginClientSideValidation.jsp is invoked
    Well so far so good
    I have also understood that to use client side validation you use validate = "true" in loginClientSideValidation.jsp
    However what I am not able to understand is how the Login-validation.xml file is being invoked
    Any help would be highly appreciated.
    thanks and regards,

    Hi ^^^,
    i found something interesting that I want to share
    Validation rules are handled by validators, which must be registered with the ValidatorFactory (using the registerValidator method). The simplest way to do so is to add a file name validators.xml in the root of the classpath (/WEB-INF/classes) that declares all the validators you intend to use.
    validators.xml if being defined should be available in the classpath. However this is not necessary, if no custom validator is needed. Webwork will automatically picked up a predefined sets of validators defined in com/opensymphony/xwork/validator/validators/default.xml packaged together in xwork jar file that comes with webwork distribution.
    So this is clear that the validators are defined in validators.xml or default.xml
    What is still not clear is how is the Login-validation.xml being called by jsp page to do verification and then linking to validators.xml to apply the rules.
    However people have been telling me that ----" Struts 2.0 have inbuilt functionalities to validate the Parameters" and that i need to
    "Define configuration file *-validation.xml or use annotations
    i) className-validation.xml
    ii) place this file in the directory where .class file is placed example.Login should have Login-validation.xml
    Do you all think is this sufficient for an answer or should my search go on?
    thanks and regards,
    Prashant
    Edited by: pksingh79 on Sep 13, 2008 10:08 AM

  • Struts can't display the input jsp page

    Hello,
    I'm using Struts 1.3.8 to construct a simple user registration system, in which the user could input his info (such as uuname and gpin, both are strings) in a jsp page, and after the submit, the system should go to a success page. However, somehow, when I access the url, it goes directly to the success page, but not stay at the input page.
    Here is my {color:#ff0000}struts-xml.config{color}
    bq. <?xml version="1.0" encoding="UTF-8"?> \\ <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd"> \\ <struts-config> \\ <form-beans> \\ <form-bean name="{color:#ff0000}anotherUserForm{color}" type="com.visualbuilder.struts.beans.AnotherUser" /> \\ </form-beans> \\ <!-- Global Exceptions --> \\ <global-exceptions></global-exceptions> \\ <!-- Global Forwards --> \\ <global-forwards> \\ <forward name="success" path="success.jsp"/>     </global-forwards> \\ <!-- Action Mappings --> \\ <action-mappings> \\ <action path="/{color:#ff0000}addanotheruser{color}" type="com.visualbuilder.struts.action.AddAnotherUserAction" name="{color:#ff0000}anotherUserForm{color}" attribute="user" input="{color:#ff0000}/addanotheruser.jsp{color}" cancellable="true"> \\ </action> \\ </action-mappings> \\ <!-- Message Resources --> \\ <message-resources \\ parameter="registration.resources.ApplicationResources" /> \\ </struts-config>
    My action class is:
    package com.visualbuilder.struts.action;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import com.visualbuilder.struts.beans.AnotherUser;
    public class AddAnotherUserAction extends Action {
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    if (isCancelled(request)) {
    return mapping.findForward("welcome");
    {color:#ff0000}AnotherUser anotherUser = (AnotherUser) form;{color}
    System.out.println("UUName: " + anotherUser.getUuname() + "\tGPIN: " + anotherUser.getGpin());
    {color:#ff0000}return mapping.findForward("success");{color}
    My ActionForm class is:
    package com.visualbuilder.struts.beans;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    public class AnotherUser extends ActionForm {
    private static final long serialVersionUID = 1058901817587421984L;
    private String uuname;
    private String gpin;
    public String getGpin() {
    return gpin;
    public void setGpin(String gpin) {
    this.gpin = gpin;
    public String getUuname() {
    return uuname;
    public void setUuname(String uuname) {
    this.uuname = uuname;
    @Override
    public void reset(ActionMapping mapping, HttpServletRequest request) {
    uuname = null;
    gpin = null;
    @Override
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    return errors;
    The input jsp page is addanotheruser.jsp:
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Another User Registration</title>
    </head>
    <body>
    <h1>Another User Registration</h1>
    <html:errors />
    <table>
    {color:#ff0000}<html:form action="addanotheruser">{color}
    <tr>
    <td>UUName</td>
    <td>{color:#ff0000}<html:text property="uuname"></html:text>{color}*</td>
    </tr>
    <tr>
    <td>GPIN</td>
    <td>{color:#ff0000}<html:text property="gpin"></html:text>{color}*</td>
    </tr>
    <tr>
    <td><html:submit/></td>
    <td><html:cancel/></td>
    </tr>
    </html:form>
    </table>
    </body>
    </html>
    Everytime I access http://localhost:9080/addanotheruser.do, it jumps to the success.jsp, but not stay at addanotheruser.jsp to wait for the user input, and in the server's console, I could see the output "UUName: null GPIN: null"
    I've been stuck at this simple program for three days, could anybody help to find the errors? Thanks a lot.

    sorry, the post looks ugly. Does anybody know how to make the indent not disappear?

  • What is the exact use of STRUTS frame work??

    Hi every one,
    I'm new to this STRUTS frame work. Can any one explain me in detail (if possible with an example) about,, why we need to use STRUTS framework as we have already JSP's.
    For example if we want to move from one JSP to another JSP, it is quite easy to move to the page with out any other extra logic. Where as comes to the point of STRUTS, we need to write, JSP form, Form-bean class, Action Class, configure our STRUTS XML file, if validation needed validation xml files. Is it not looking cumbersome to process?
    Please help me to recover from this...
    Expecting reply from many of you..
    Thanx in advance.
    Sriram

    meetshriram wrote:
    Hi every one,
    I'm new to this STRUTS frame work. Can any one explain me in detail (if possible with an example) about,, why we need to use STRUTS framework as we have already JSP's. Struts is a web MVC-2 framework.
    For example if we want to move from one JSP to another JSP, it is quite easy to move to the page with out any other extra logic. No, there's logic, and it's embedded into the page.
    It's fine for one page to another, but when you have a substantial application that has tens or hundreds of JSPs it's much harder to manage.
    Where as comes to the point of STRUTS, we need to write, JSP form, Form-bean class, Action Class, configure our STRUTS XML file, if validation needed validation xml files. Is it not looking cumbersome to process?
    Extra complexity does cost you something. Ask yourself what it's buying you: better layering, more configuration and less code, validation, etc.
    %

  • Exception while running STRUTS application???

    HI,
    This is my 2nd post regarding my struts application, previous error was solved, but when i'm tryin to run my application with tomcat i'm getting error(plz help me tellin what changes i've to do in my application).It is actually the first page of the application which is a simple index.jsp, from where i've links to other main pages.The error i'm getting is:-
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NullPointerException
    org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:521)
    org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:436)
    org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:495)
    org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:353)
    org.apache.jsp.index_jsp._jspx_meth_html_link_0(index_jsp.java:96)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:69)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs.
    Apache Tomcat/5.0.27

    Here i'm posting my index.jsp(where link tag is used), search.jsp, web.xml and struts.xml.frm index.jsp i just want to go to search.jasp frm where all the real thing will start.plz have look on all these files and let me no where i'm wrong.
    index.jsp :-
    <%@ page langiuage="java" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html>
    <head>
    <title>Gaurav, Human Resource Portal</title>
    <head>
    <body>
    <font size="+1"><b>Gaurav Human Resource Portal</b></font><br>
    <hr wodth="100%" noshade="true">
    &#149; Add an Employee<br>
    &#149;<html:link forward="search">Search for Employees</html:link><br>
    </body>
    </html>
    search.jsp :-
    <%@ page language="java" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html>
    <head>
    <title>Gaurav, Human Resource Portal</title>
    </head>
    <body>
    <font size="+1"><b>Gaurav, Human Resource Portal - search.jsp</b></font>
    <hr width="100%" noshade="true">
    <html:errors/>
    <html:form action="/search">
         <table>
              <tr>
                   <td align="right"><bean:message key="label.search.name"/>:</td>
                   <td><html:text property="name"/></td>
              </tr>
              <tr>
                   <td></td>
                   <td>--- or ---</td>
              </tr>
              <tr>
                   <td align="right"><bean:message key="label.search.ssNum"/>:</td>
                   <td><html:text property="ssNum"/> (xxx-xx-xxxx)</td>
              </tr>
              <tr>
                   <td></td>
                   <td><html:submit/></td>
              </tr>
         </table>
    </html:form>
    <logic:present name="searchForm" property="results">
         <hr width="100%" size="1" noshade="true">
         <bean:size id="size" name"searchForm" property="results"/>
              <logic:equal name="size" value="0">
                   <center><font color="red"><b>No Employees Found</b></font></center>
              </logic:equal>
              <logic:greaterThan name="size" value="0">
                   <table border="1">
                        <tr>
                             <th>Name</th>
                             <th>Social Security number</th>
                        </tr>
                        <logic:iterate id="result" name="searchForm" property="results">
                        <tr>
                             <td><bean:write name="result" property="name"/></td>
                             <td><bean:write name="result" property="ssNum"/></td>
                        </tr>
                        </logic:iterate>
                   </table>
              </logic:greaterThan>
    </logic:present>
    </body>
    </html>
    web.xml :-
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <display-name>Gaurav MiniHR Portal</display-name>
    <!-- Standard Action Servlet Configuration (with debugging) -->
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>2</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <!-- Standard Action Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!-- The Usual Welcome File List -->
    <welcome-file-list>
    <welcome-file>/index.jsp</welcome-file>
    </welcome-file-list>
    <!-- Struts Tag Library Descriptors -->
    <taglib>
    <taglib-uri>/tags/struts-bean</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-html</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-logic</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-nested</taglib-uri>
    <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-tiles</taglib-uri>
    <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
    </taglib>
    </web-app>
    struts-config.xml :-
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
         <!-- ==========Form Beans configuration section.(i.e ActionForm objects)========== -->
         <form-beans>
              <form-bean name="searchForm" type="com.jamesholmes.minihr.SearchForm" />
    </form-beans>
    <global-forwards>
              <forward name="search" path="/search.jsp" />
    </global-forwards>
    <!-- =================================== Action Mapping Definitions -->
    <action-mappings>
              <action path="/search"
                        type="com.jamesholmes.minih.SearchAction"
                        name="searchForm"
                        scope="request"
                        validat="true"
                        input="/search.jsp"
              </action>
    </action-mappings>
    <!-- ================================ Message Resources Definitions -->
    <message-resources parameter="com.jamesholmes.minihr.ApplicationResources"/>
    </struts-config>

  • Struts 2 Client side validation getting skipped.

    I am doing a simple program using struts 2. Usually in struts2 bean class will be combined with action class unlike in struts 1.2. But for enhancing readability I made a seperate bean class and I reference it in my action class. But after seperating bean from action class Client side validation using xml is not happening. It is getting skipped. But server side validation inside execute() is happening. Will anyone please help me to find a solution to make client side validation run.
    here are the different files.
    1) JSP File - SEmail.jsp
    <%@ taglib prefix="s" uri="/struts-tags"%>
    <html>
    <s:head theme="ajax" />
    <title>SEmail </title>
    <body>
    <center><font color="blue" size="5" face="bold">
    <s:label     value="Secure Email - Non Registered User" /> </font></center>
    <br>
    <font color="red" size="3"> <s:label
         value="Want to contact us?."></s:label>
    </font>
    <center><s:form action="/Semail.action" method="POST"
         validate="true">
         <s:actionerror />
         <s:select label="Topic" name="user.topic" headerKey="-1" required="true"
              list="#{'Plan Coverage':'Plan Coverage','Sales':'Sales','Others':'Others'}">
         </s:select>
         <s:textarea name="user.message" label="Message" rows="4" cols="50"
              required="true" />
         <br>
         <s:label value="Contact Information" />
         <br>
         <table align="center" width="500">
              <tr align="left">
                   <td align="left"><s:select label="Title" name="user.title"
                        headerKey="-1" required="true"
                        list="#{'-- Select One --':'-- Select One --','Mr.':'Mr.','Ms.':'Ms.','Mrs.':'Mrs.'}">
                   </s:select></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="First Name"
                        name="user.firstname" size="20" maxlength="35" required="true" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="Family Name"
                        name="user.familyname" size="20" maxlength="35" required="true" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="Profession"
                        name="user.profession" size="20" maxlength="20" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="Address" name="user.address"
                        size="20" maxlength="100" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="Telephone Number"
                        name="user.telnumber" size="20" maxlength="20" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="P.O. Box" name="user.pobox"
                        size="20" maxlength="8" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="City"
                        name="user.emirate" size="20" maxlength="35" required="true" /></td>
              </tr align="left">
              <tr>
                   <td align="left"><s:textfield label="Region and Country"
                        name="user.country" size="20" maxlength="35" /></td>
              </tr>
              <tr align="left">
                   <td align="left"><s:textfield label="E-mail Address"
                        name="user.email" size="20" maxlength="70" required="true" /></td>
              </tr>
         </table>
         <br>
         <s:file name="user.uploadFile" label="Upload Document" />
         <br>
         <br>
         <s:submit value="Submit" align="center"></s:submit>
    </s:form></center>
    <font color="red" size="3"> <s:label
         value="All fields marked (*) are mandatory."></s:label>
    </body>
    </html>
    2) struts.xml
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
         <package name="semail" extends="struts-default">
              <action name="Semail" class="semail.NonregUser">
                   <result name="input">/SEmail.jsp</result>
                   <result name="error">/SEmail.jsp</result>
                   <result>/SEmail.jsp</result>
              </action>          
         </package>     
    </struts>
    3) Bean Class - User.java
    package semail;
    public class User {
         private String topic;
         private String message;
         private String title;
         private String firstname;
         private String familyname;
         private String profession;
         private String address;
         private int telnumber;
         private String pobox;
         private String city;
         private String country;
         private String email;
         private String uploadFile;
         private String testing;
         public String getTopic() {
              return topic;
         public void setTopic(String topic) {
              this.topic = topic;
         public String getMessage() {
              return message;
         public void setMessage(String message) {
              this.message = message;
         public String getTitle() {
              return title;
         public void setTitle(String title) {
              this.title = title;
         public String getFirstname() {
              return firstname;
         public void setFirstname(String firstname) {
              this.firstname = firstname;
         public String getFamilyname() {
              return familyname;
         public void setFamilyname(String familyname) {
              this.familyname = familyname;
         public String getProfession() {
              return profession;
         public void setProfession(String profession) {
              this.profession = profession;
         public String getAddress() {
              return address;
         public void setAddress(String address) {
              this.address = address;
         public int getTelnumber() {
              return telnumber;
         public void setTelnumber(int telnumber) {
              this.telnumber = telnumber;
         public String getPobox() {
              return pobox;
         public void setPobox(String pobox) {
              this.pobox = pobox;
         public String getCity() {
              return city;
         public void setCity(String city) {
              this.city= city;
         public String getCountry() {
              return country;
         public void setCountry(String country) {
              this.country = country;
         public String getEmail() {
              return email;
         public void setEmail(String email) {
              this.email = email;
         public String getUploadFile() {
              return uploadFile;
         public void setUploadFile(String uploadFile) {
              this.uploadFile = uploadFile;
         public String getTesting() {
              return testing;
         public void setTesting(String testing) {
              this.testing = testing;
    This is my bean class. Instead of putting it with action class NonregUser.java , I have seperated it out for readability. And I am referencing it in the action class.
    4) Action Class - NonregUser.java
    package semail;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts2.interceptor.ServletRequestAware;
    import org.apache.struts2.interceptor.ServletResponseAware;
    import com.opensymphony.xwork2.ActionSupport;
    public class NonregUser extends ActionSupport implements ServletRequestAware,
              ServletResponseAware {
         private static final long serialVersionUID = 2451855813074437309L;
         HttpServletRequest request = null;
         HttpServletResponse response = null;
         private User user = null;
    /* I am referencing my bean class here instead of writing all the getters and setters here.*/
         public User getUser() {
              return user;
         public void setUser(User user) {
              this.user = user;
         public String execute() throws Exception {
              System.out.println("Validating login");
              if(user!=null){
                   System.out.println(user.getFirstname());
                   System.out.println(user.getEmail());
                   System.out.println(user.getTopic());
                   System.out.println(user.getTitle());
    // this server side validation is happening
                   if (user.getTitle().trim().equals("-- Select One --")) {
                        addActionError("Please select Title");
                        return ERROR;
                   } else {
                        return SUCCESS;
              }else{
                   return SUCCESS;
         public void setServletRequest(HttpServletRequest arg0) {
              System.out
                        .println("HttpServletRequest : " + NonregUser.this.getClass());
              request = arg0;
         public void setServletResponse(HttpServletResponse arg0) {
              System.out.println("HttpServletResponse : "
                        + NonregUser.this.getClass());
              response = arg0;
    This is my acation class. Here I am referencing my bean class User.java.
    5) xml validation file - NonregUser-validation.xml
    /*This client validatin is not working*/
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE validators PUBLIC
              "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
              "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
    <validators>
         <field name="topic">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please select the Topic</message>
              </field-validator>
         </field>
         <field name="message">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please enter Message</message>
              </field-validator>
              <field-validator type="stringlength">
                   <param name="maxLength">8000</param>
    <message>Message cannot contain more than 8000 characters</message>
              </field-validator>
         </field>
         <field name="title">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please select the Title</message>
              </field-validator>
         </field>
         <field name="firstname">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please enter First name</message>
              </field-validator>
              <field-validator type="stringlength">
                   <param name="maxLength">35</param>
    <message>First Name cannot contain more than 35 characters</message>
              </field-validator>
         </field>
         <field name="familyname">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please enter Family name</message>
              </field-validator>
              <field-validator type="stringlength">
                   <param name="maxLength">35</param>
    <message>Family Name cannot contain more than 35 characters</message>
              </field-validator>
         </field>
         <field name="emirate">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please enter Emirate/City</message>
              </field-validator>
         </field>
         <field name="email">
              <field-validator type="requiredstring">
                   <param name="trim">true</param>
                   <message>Please enter Email address</message>
              </field-validator>
              <field-validator type="email">               
                   <message>Please enter a valid Email address</message>
              </field-validator>
         </field>
    </validators>
    6) web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app>
         <filter>
         <filter-name>struts2</filter-name>
         <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
         </filter>
         <filter-mapping>
         <filter-name>struts2</filter-name>
         <url-pattern>/*</url-pattern>
         </filter-mapping>
         <welcome-file-list>          
              <welcome-file>/SEmail.jsp</welcome-file>
         </welcome-file-list>     
         <error-page>
    <error-code>404</error-code>
    <location>/pagenotfound.jsp</location>
    </error-page>
    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/error.jsp</location>
    </error-page>
    </web-app>
    Edited by: L-J-K on Jul 22, 2008 5:22 AM

    I was trying to do it through creating a new validators.xml where I would redefine all struts built in validations and add de definition for my custom Validation (<validator name="checkUser" class="com.custom.CustomUserValidator"/>). Then I define the ActionClassName-action-validation.xml refering to my custom validator (checkUser). The com.custom.CustomUserValidator Class has to extend FieldValidatorSupport or ValidatorSupoort (depending on what kind of validation).
    Ok that's it, this is the theory, now the custom validator (checkUser) is executed before my action but I don't know how to do it so that if the validation fails i return to the same page showing the error message to the user without having to execute the target action. Does anyone know how to do this????

  • Struts 2.0 validations

    Hi , all
    I have a problem with struts validations, I am using struts2.0, in the button action of jsp if I won't pass any parameters valitions are happening with struts validators , if I pass any parameters in the button action it's ignoring the validations , so please give the solution how to do the validations while passing the parameters in the action of button click in the jsp & I am passing the parameters in struts.xml also like "myaction/*"
    Thanks

    updationThere is no such friggin' word. If you own a dictionary that has it, then burn it, NOW!

  • Calling DB from Struts

    Hi All,
    I would like to access Database from struts without using EJB, Pl. advice which architecture is best
    Thanks

    Dear dsn29:
    There are basically 2 ways to call databases:
    1. To call using JDBC directly
    2. To call using a database pool connection
    Using the 2nd one you can use:
    a) Struts own connection pool,
    b) the server application server connection pool if it has one,
    c) a connection pool implementation ftrom a 3rd party like jakarta db connection pool.
    Which one is the better one?
    Well depend on how you like to code or deploy. The thing I have noticed is that Jakarta connection pool works very well and it is very independant. The only problem is that you have to define the connection either on tomcat's server.xml or in the META-INF/context.xml.
    Using the connection implementation that comes with the server like Sun App Server 8.1 Q12005, is that you have to install the driver in the domain/lib/ext directory, you have to define the connection correctly at the first time (the server must recognize it to show all the drivers parameters) or you will always get a bad ping. And there are several problems with the Sun's implementation that they haven't answer back. For me the connection pool was been a pain in the neck (just search from lorenzosjb username to see). Just look my last: http://forum.java.sun.com/thread.jspa?threadID=612144&tstart=30
    Finally, Struts own implementation connection pool you have to configure using the config-struts.xml . Goto to www.wrox.com and download the source code for Professional Struts (James Goodwill and Richard HighTower) and you can purchase this excellent book . The db connection pool is on chapter 11.
    You can also go to http://www.objectsource.com/ where you can download a free book called Struts Best Practices that can help you
    And you can www.theserverside.com and download Jakarta Struts Live and Servlets and JavaServer Pages: The J2EE Technology Web Tier for free: http://www.theserverside.com/books/addisonwesley/ServletsJSP/index.tss that can help you more.
    So now I am also investigating, using Struts db implementation and installing the test web application in several java application servers to see if the implementation is really independant.
    You I helped you, and good luck!
    Regards,
    Lorenzo

  • Struts Token Interceptor - Not working

    Hi,
    I have checked all the answers to this question on this forum but none resolve my issue.
    I need to stop the user from resubmitting the form. So naturally turned to Token interceptor
    I get the below warning and the page is redirected to global results for invalid.token:
    Apr 10, 2011 10:50:19 PM org.apache.catalina.core.StandardContext start  
    INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/VulMgmt] has already been started  
    Apr 10, 2011 10:51:13 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn  
    WARNING: Could not find token name in params.  
    Apr 10, 2011 10:51:13 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn  
    WARNING: Could not find token name in params.Here is my struts.xml config:
            <interceptors>  
                <interceptor name="mylogging" class="com.vulmgr.MyLoggingInterceptor"/>  
                <interceptor-stack name="loggingStack">  
                <interceptor-ref name="mylogging"/>  
                    <interceptor-ref name="fileUpload">  
                        <param name="maximumSize">909715200</param>  
                        <param name="allowedTypes">  
                        text/xml,application/octet-stream  
                        </param>  
                    </interceptor-ref>  
                    <interceptor-ref name="defaultStack" />  
                </interceptor-stack>  
                <interceptor-stack name="token-submit" >  
                                   <interceptor-ref name="tokenSession" />  
                                   <interceptor-ref name="loggingStack"/>  
                </interceptor-stack>  
            </interceptors>  
            <default-interceptor-ref name="loggingStack" />  
            <action name="fileUpload" class="com.vulmgr.actions.FileUploadAction">  
                <interceptor-ref name="token-submit"/>  
                <result name="success">/WEB-INF/pages/HelloWorld.jsp</result>  
                <result name="input">/WEB-INF/pages/fileupload.jsp</result>  
                <result name="error">/WEB-INF/pages/fileupload.jsp</result>  
            </action>  My JSP page snippest ( I have tried with out name attribute, using token, struts.token etc as name value but same issue).
        <s:form action="fileUpload" method="post" enctype="multipart/form-data">  
            <s:token name="doublePost"/>  
         </s:form>
    Any hints on what is missing?
    Thanks

    Solved the issue. Here it is for them who face the same problem.I made the value attribute to false from true for inputForward.This is working fine.
    <controller
    contentType="text/html;charset=UTF-8"
    debug="3"
    locale="true"
    nocache="true"
    processorClass="org.apache.struts.action.PortletRequestProcessor">
    <set-property property="inputForward" value="false"/>
    </controller>
    Thanks.....

  • Unable to deploy struts 2 in tomcat 5.5.16

    Hi ,
    I have developed a sample example in struts 2 using tomcat5.5.16,but when I try to deploy it gives me 404 error , I am unbale to figure out whats the error.
    regards
    srini

    Hi,
    Thx for the reply ,
    my folder structure ,I have WEB_INF ,under it classes ,web.xml and lib
    and under classes struts.xml
    I am using struts 2 frame work when i try commenting the filter part in web.xml its working fine
    my webxml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>Struts Blank</display-name>
         <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
         </filter>
         <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
         </filter-mapping> </web-app>
    #########struts.xml
    <struts>
    <package name="dd" extends="struts-default">
    <action name="hello" classs="dd.hello">
    <result>/hello.jsp</result>
    </action>
    </package>
    </struts>

  • Struts 2: Doesn't populate an array of java beans in action classes

    Hello,
    Currently i am working on Struts 2 based application, in which i need to populate an array of Java beans from the form.
    The problem, I am facing is:
    Struts 2 is not instantiating an array of beans
    I have gone through the Data transfer and Type Conversion of struts of 1.2, but every where I can see only following:
    1 An array of primitive data types
    2 List of primitive / Java bean
    3 Map of primitive / Java bean
    but i can't see the docs on An array of Java Beans.
    What I can't do in my application is:
    1 Can not convert an array of beans into java.util.List<beans>
    2 Can not instantiate the bean array (As the number of elements will be decided by the front end - form)
    Please have a look at my configuration file:
    struts.xml:+
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
    <constant name="struts.devMode" value="true" />
    <include file="test/test.xml"/>
    </struts>
    test.xml:+
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
    <package name="test" namespace="/test" extends="struts-default">
    <action name="TestInput">
    <result>/test/input.jsp</result>
    </action>     
    <action name="TestOutput" class="test.Controller">
    <result name="SUCCESS">/test/output.jsp</result>
    </action>
    </package>
    </struts> Controller.java+
    package test;
    public class Controller {
    private String id = null;
    private Contact[] contacts = null;
    public String execute()  {
    System.out.println("***********************************");
    System.out.println("id::: " + getId());
    System.out.println("contacts::: " + getContacts());
    System.out.println("***********************************");
    return "SUCCESS";
    public Contact[] getContacts() {
    return contacts;
    public void setContacts(Contact[] contacts) {
    this.contacts = contacts;
    public String getId() {
    return id;
    public void setId(String id) {
    this.id = id;
    } Contact.java:+
    package test;
    public class Contact {
    private String name = null;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    }+ input.jsp:+
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ taglib prefix="s" uri="/struts-tags" %>
    <html>
    <head>
    <title>Test Form</title>
    </head>
    <SCRIPT type="text/javascript">
    // Total number of contacts in the mail request form
    var totalContacts = 0;
    function addContact() {
    var tbody = document.getElementById('testTable').getElementsByTagName('tbody')[0];
    var row = document.createElement('TR');
    var td1 = document.createElement('TD');
    var td2 = document.createElement('TD');
    var inputBox = document.createElement('INPUT');
    td1.innerHTML = new String('Contact ' + (totalContacts + 1) + ' :');
    inputBox.type = 'text';
    inputBox.name = 'contacts['+totalContacts+'].name';
    //inputBox.name = 'contacts.name';
    td2.appendChild(inputBox);
    row.appendChild(td1);
    row.appendChild(td2);
    tbody.appendChild(row);
    // Add to the total number of contacts
    totalContacts += 1;
    </SCRIPT>
    <body>
    <h4>Mail Request Form</h4>      
    <s:form action="TestOutput">
    <table border="1" id="testTable">
    <tr>
    <td colspan="2">
    <s:textfield name="id" label="Request Id"/>
    </td>
    </tr>
    <tr>
    <td align="left">
    <input type="button" value="Add Contact" onklick="javascript:addContact();"/>
    </td>                              
    <td align="right">
    <s:submit/>                         
    </td>     
    </tr>     
    </table>
    </s:form>
    </body>
    </html>
    + output.jsp:+ Not concerned right now
    Exception got in the logs after submitting the form:+
    java.lang.InstantiationException: [Ltest.Contact;
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:123)
    at com.opensymphony.xwork2.util.InstantiatingNullHandler.createObject(InstantiatingNullHandler.java:123)
    at com.opensymphony.xwork2.util.InstantiatingNullHandler.nullPropertyValue(InstantiatingNullHandler.java:104)
    at ognl.ASTProperty.getValueBody(ASTProperty.java:94)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
    at ognl.SimpleNode.getValue(SimpleNode.java:210)
    at ognl.ASTChain.setValueBody(ASTChain.java:168)
    at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
    at ognl.SimpleNode.setValue(SimpleNode.java:246)
    at ognl.Ognl.setValue(Ognl.java:476)
    at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
    at com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:158)
    at com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:146)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:193)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:159)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
    at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Unknown Source)
    Please give me suggestions to move forward
    Thanks in advance
    Vikas Parikh

    I am having the same issue. It appears that the RequestProcessor.processValidate adds the errors (ActionMessages) to the request the does a forward. As such the errors are not available to the jsp page. Does any one know a way to get round this?

  • Struts 2 protlet plugin. Validation errors.

    Hi.
    I have some errors while validating my form.
    struts.xml
    <struts>
        <constant name="struts.devMode" value="true" />
        <constant name="struts.custom.i18n.resources" value="globalMessages" />
        <package name="view" extends="struts-portlet-default" namespace="/view">
            <action name="AddClientRequestAction_*" method="{1}" class="autopay.portlet.action.AddClientRequestAction">
                <result name="input">/WEB-INF/jsp/view/addRequest.jsp</result>
                <result name="source">/WEB-INF/jsp/view/addRequest.jsp</result>
                <result>/WEB-INF/jsp/view/ok.jsp</result>
            </action>
        </package>
    </struts>
    AddClientRequestAction
    public class AddClientRequestAction extends ActionSupport {
        private String a = "aaaaaaaaaaaaa";
        @Override
        public String execute() throws Exception {
            System.out.println("a: " + a);
            if (isInvalid(a)) return INPUT;
            addActionMessage("my action message");
            return SUCCESS;
        public String getA() {
            return a;
        public void setA(String a) {
            this.a = a;
        public void validate() {
            System.out.println("AddClientRequestAction - VALIDATE!!!");
            super.validate();
        private boolean isInvalid(String value) {
            return (value == null || value.length() == 0);
    Exception
    2008-10-27 18:56:52,452 ERROR [org.jboss.portal.core.model.portal.control.page.DefaultPageControlPolicy] Rendering portlet window produced an error
    javax.portlet.PortletException: Error executing action renderDirect....
    Caused by: javax.portlet.PortletException: org.apache.jasper.JasperException: java.lang.NullPointerException
    at org.jboss.portal.portlet.impl.jsr168.api.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:91)
    interesting part
    Caused by: java.lang.NullPointerException
    at java.text.MessageFormat.applyPattern(MessageFormat.java:422)
    at java.text.MessageFormat.<init>(MessageFormat.java:350)
    at com.opensymphony.xwork2.DefaultTextProvider.getText(DefaultTextProvider.java:70)
    at com.opensymphony.xwork2.DefaultTextProvider.getText(DefaultTextProvider.java:111)
    at org.apache.struts2.util.TextProviderHelper.getText(TextProviderHelper.java:62)
    at org.apache.struts2.util.TextProviderHelper.getText(TextProviderHelper.java:105)
    at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:631)
    at org.apache.struts2.components.UIBean.end(UIBean.java:509)
    at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
    at org.apache.jsp.WEB_002dINF.jsp.view.addRequest_jsp._jspx_meth_s_005ftextfield_005f0(addRequest_jsp.java:200)
    at org.apache.jsp.WEB_002dINF.jsp.view.addRequest_jsp._jspx_meth_s_005fform_005f0(addRequest_jsp.java:132)
    at org.apache.jsp.WEB_002dINF.jsp.view.addRequest_jsp._jspService(addRequest_jsp.java:73)
    addRequest_jsp.java line 199
    int _jspx_eval_s_005ftextfield_005f0 = _jspx_th_s_005ftextfield_005f0.doStartTag();if (_jspx_th_s_005ftextfield_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
    _005fjspx_005ftagPool_005fs_005ftextfield_005fkey_005fnobody.reuse(_jspx_th_s_005ftextfield_005f0);
    return true;
    } Could anyone help me with this?
    Thanks.

    Caused by: java.lang.NullPointerException
    at java.text.MessageFormat.applyPattern(MessageFormat.java:422)Extract from line 422 of MessageFormat.java as it is in Java 1.6.0_07:for (int i = 0; i < pattern.length(); ++i) {Thus, pattern is null. It is been passed as method parameter. Thus, the framework is passing null along it.
    at java.text.MessageFormat.<init>(MessageFormat.java:350)
    at com.opensymphony.xwork2.DefaultTextProvider.getText(DefaultTextProvider.java:70)
    at com.opensymphony.xwork2.DefaultTextProvider.getText(DefaultTextProvider.java:111)
    at org.apache.struts2.util.TextProviderHelper.getText(TextProviderHelper.java:62)Look like a bug in Struts2 or maybe just in your own code (miscoding/misconfiguration/etc). At least not in JSP nor JSTL or any other Sun library. I recommend to repost this problem at their own forum / mailinglist / issuetracker over there at their homepage at apache.org.

  • Struts 2 Integration problem witn Coldfusion in CF 8 MX server

    I have successfully integrated struts 2 with existing coldfusion mx 8 server. The action classes are invoked and executed. However the struts tags are not getting instantiated in my jsps.
    Steps i tried:
    - configuring wwwroot/web-inf/web.xml in coldfusion 8
    - adding relevant jars.
    - packaging struts 2 actions under '/extended' context since wwwroot is not supporting context.
    - placing 'struts.xml' under '../runtime/lib' since the struts.xml is not being recognized under '/wwwroot/web-inf/classes'
    All the jsps render and action executes my code. However, when i try using struts-tags like <s:form>
    it throws an exception which looks like:
    04/08 21:42:05 error Translator.CompilationFailedExceptionCompiler errors:
    Found 12 semantic errors compiling "C:/ColdFusion8/wwwroot/WEB-INF/jsp/jrun__pages__response32ejsp14.java":
        64. org.apache.struts2.views.jsp.ui.FormTag _tag0 = (org.apache.struts2.views.jsp.ui.FormTag) pageContext.getTagHandlerInstance(0,org.apache.struts2.views.jsp.ui.FormTag.class);
                                            ^-----^
    *** Semantic Error: The class file "StrutsBodyTagSupport.class" in "C:\ColdFusion8\wwwroot\WEB-INF\lib\struts2-core-2.0.11.1.jar\org\apache\struts2\views\js p" has an invalid format (bad string annotation constant).
        64. org.apache.struts2.views.jsp.ui.FormTag _tag0 = (org.apache.struts2.views.jsp.ui.FormTag) pageContext.getTagHandlerInstance(0,org.apache.struts2.views.jsp.ui.FormTag.class);
                                                             ^-------------------------------------^
    *** Semantic Error: Type "FormTag" was not found.
    134. org.apache.struts2.views.jsp.ui.SubmitTag _tag3 = (org.apache.struts2.views.jsp.ui.SubmitTag) pageContext.getTagHandlerInstance(3,org.apache.struts2.views.jsp.ui.SubmitTag.class);
                                                                                                                                               ^---------------------------------------^
    *** Semantic Error: Type "SubmitTag" was not found.
        at jrunx.compiler.JavaCompiler.compile(JavaCompiler.java:135)
        at jrunx.compiler.JavaCompiler.compile(JavaCompiler.java:94)
        at jrun.jsp.Translator.compilePage(Translator.java:176)
        at jrun.jsp.Translator.translate(Translator.java:254)
        at jrun.jsp.Translator.translate(Translator.java:101)
        at jrun.jsp.JSPEngine.translateJSP(JSPEngine.java:707)
        at jrun.jsp.JSPServlet.translate(JSPServlet.java:125)
        at jrun.jsp.JSPServlet.service(JSPServlet.java:113)
        at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
        at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
        at jrun.servlet.JRunRequestDispatcher.invokeNext(JRunRequestDispatcher.java:584)
        at jrun.servlet.JRunRequestDispatcher.forwardInvoke(JRunRequestDispatcher.java:553)
        at jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:64)
        at coldfusion.license.JspLicenseServlet.service(Unknown Source)
        at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
        at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
        at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
        at jrun.servlet.JRunRequestDispatcher.invokeNext(JRunRequestDispatcher.java:584)
        at jrun.servlet.JRunRequestDispatcher.forwardInvoke(JRunRequestDispatcher.java:553)
        at jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:201)
        at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.j ava:139)
        at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
        at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.jav a:348)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
    I tried extracting the 'struts-tags.tld' and placing it in 'wwwroot/web-inf/lib' and defining in web.xml, but in vain. Please help me out with this issue.
    Thanks in advance

    torstenp wrote:
    > for the last 10 days after a server restart the
    scheduled tasks all run twice.
    > This is a HUGE problem for a process that does not
    complete immediately and
    > moves / creates files.
    The first thing I would look for is more then one instance of
    ColdFusion
    running, each one processing the scheduled task. There could
    easily
    have been another ColdFusion process that had been turned off
    in the
    services panel that was restarted with the server reboot.

Maybe you are looking for

  • How to use logical operator in struts logic:equal

    Hi All, I need to translate: if ( a == 'option1' || a == 'option2' ) to struts code.... I don't know how to put || or && in <logic:equal.... ?�?�?�? Many thanks

  • Field catalog in Profitability Analysis

    Hi, In profitability analysis, if we want to use a particular characteristic or value field, then they should be maintained in field catalog. Could anyone please explain me where we will define this field catalog. Thanks Chandra

  • Add photos to shared stream

    Hi all. Hope my English be comprehensible :-) Yesterday evening at home I created a shared photo stream from within iPhoto on my Mac Book Pro (Mountain Lion, iPhoto & Aperture all with last updates). I added two shots and shared them with one of my c

  • Database Resident Connection Pooling (DRCP)

    Hi there, Im playing with DRCP on SLES but its not acting as I would expect. Given the lack of any hard info out there I thought I would check my understanding as its probably/possibly flawed! I thought that with DRCP you would have lots of sessions

  • SSSLERR_SSL_CONNECT

    The scenario is  EP6 SP2 with IIS proxy configured.. The Front-end IIS SSL Cert expired I renewed the cert... now I am getting..following error: IisProxy.dll: 500 Internal Server Error ProxyWorker(): IOException: SapSSLStart() failed: -57 (SSSLERR_SS