JSP + Struts2

Hello,
I'm in a new project that needs to be in JSP. I'm using JSP + Struts2, do you guys think its good? Whats the best and the the most recent technologies to use with JSP?
I'm having a problem when passing JSP parameters values to Java Classes in IE8, with firefox and chrome it just works fine. Whats the problem with ie8 ?
Thanks in advance,
João

J-_-P wrote:> What should I add to make it more powerful?It only depeds on what You need to do and what does it mean 'powerful' for You. It would be better to present concrete problems, it much easier to find a solution.
If You say that don't want to use jsp script and don't like javascript, there might a problem occur. These technologies are a basement of web development. Interest in GWT, the framework from google. It might be very useful for You, there's no jsp - everything is written purely in java and the whole web-app is written in AJAX, so there's almost no page refreshing. Of course there're some limitations but You can always write native code in javascript.

Similar Messages

  • Struts2:jsp:control Text length

    I want to set limit for <s:property value="Text"/> in jsp .If i have Text which length is 50 ,here I want to display only 30 characters remaining charcters should be display like this '...'.How can i do this?
    (Or) any other idea for set text length.
    Thanks in advance.

    Sry,by mistake i have post this question in this forum.Actually my environment is struts2 (jsp,struts2) .i want to post this question into JSP relevant forum.sry
    Edited by: raj_java on Jan 9, 2013 12:43 AM

  • Pointers needed to create a JSP for week/hour calendar type component

    Hi,
    I am looking to get some pointers on how to create week/hour calendar type component in JSP.
    My application is JSP/struts2 based web application. I need to create a web page where users will see a week hour calendar and for any time slot will enter some information. Each time slot can have different information. For example: Sunday 9:30am to 10:00am - Click on this cell and pop up a dialog for info and save it without refreshing the page. At the end combine all this info for each slot and submit to the server.
    If there is already a component like this is available to use, please point me to that.
    Any ideas are welcome.
    Thanks,
    Developer in need.

    I dont know of an already existing application that can do this. However, here are some ideas on creating your own:
    Create an html table in JSP who's number of rows and columns match what you would find in an ordinary wall calendar for the given month and year. Use the Calander.java class to obtain the number of days in the current month and build the JSP page accordingly (Calendar.java should automatically take care of leap year). You will probably need to add 'next' and 'previous' buttons to the form to retrieve the previous and next month(s) in case the user wants to access previous or future months. Each cell in the table displays that day (example ' 28 '). Notice my convention the first column is usually 'Sunday'.
    Next, determine what to put in each cell. One suggestion is to embed a table in each cell with 48 rows (24 hours in a day, 1/2 hour resolution= =48), and two columns (first column is for time: example: "10:30am to 11:00am", the second column is for the user's appointment message).
    Above that embedded table is the day (example: '28'). If a user has no information in the embedded table, the outer cell will appear to have nothing but the '28' in it.
    Next, how to populate the cell. When the user clicks on the cell, have an onclick event call a javascript function. The function will pop up a new window (a child window) by calling 'window.open( )' (google 'window.open'). In the pop up, show a table with 48 rows, 2 columns that the user can type in a message within column 2. When the user clicks 'submit' button on the pop up, call a javascript onclick function that reads all the message cells. Any cell not empty will populate the corresponding cell (day, rowID, columnID) back on the parent window by calling something like this: window.opener.document.myFormName.myTextField.value = someValue
    (google 'window.opener'). Once this is done, close the child window from that javascript function. By calling 'window.opener', you dont have to refresh the parent window.
    Next, if the user clicks on the parent window cell that is already populated, you will have to pass all theexisting information for that day through the window.open( ) to the child window so the pop up child window will show that preexisting information (that way he can add to the cell or alter it as he pleases).
    Next, after he alters many days on the calender, you have to provide an 'update' button on the parent form so the user saves his changes (write the data to a database record, with his name attached to that record). Note: if he clicks the previous/next button, he will lose any changes unless you also save the information before going to the previous/next page.
    Next, you might want to provide a vertical scroll bar on the table cell if
    the end user has many messages that cant be viewed in the parent cell all at once. Note each cell should be a fixed number of pixels width/height so it shows correctly. Have Fun!

  • Array of Fields in JSP page

    hi,
    i am just a biginer in java forum& application developement,
    *********problem****************
    I am using jsp+struts2 combination. one of my jsp page contains a select field to select number (n).
    on basis of that selected number(n) I've to display n text fields.for every text field there is an submit button.
    how it is possible? using arry index?

    Yes, you can use the array notation in the name of the input element. You should end up with something like:
    <table>
        <tr><td><input name="input[0]"></td></tr>
        <tr><td><input name="input[1]"></td></tr>
        <tr><td><input name="input[2]"></td></tr>
    </table>
    <input type="hidden" name="rows" value="3">You can use JSTL c:forEach with a varStatus for this.

  • Help a beginner start....

    I'm looking into developing a website using either JSP or servlets. However, I have hard time starting due to the difficulty of identifying what I need. I very well versed with Java, but have little experience with JSP or servlets. My knowledge in JSP/Servlets come from reading a book briefly years ago. I have great knowledge of programming and understand web technology. I have programmed dynamic sites in PHP and ColdFusion.
    What I'm trying to accomplish is a site that has the following attributes:
    - create general classes that can be used across multiple sites i.e. database access class etc... (portable code) I intend to start with a small test site, but design it with a larger production web site in mind.
    - prefer if they work with hosting companies (which probably limites me to JSP), but is not a requirement
    - has an easily updated front end i.e. look and feel to site (Struts2 seems to fit this bill). PHP is extremely difficult to update the look and feel of a site. I suspect JSP would be the same....
    I dabbled around with WebSphere and DB2 for a while, but got nowhere since it was rather difficult to get setup and started properly. So here are my questions:
    1) What technology should I at least take a look at before making a decision? (I'm strongly considering JSP + Struts2 + Dojo, but many have recommended Google Web Toolkit)
    2) What web server should I be looking at? (Tomcat, Websphere, JBoss.... I realise that hosting companies probalby use Tomcat)?
    3) What do people use for small sites that could have been done in PHP, but like the extendability and backwards compatibility of Java? JSP or Servlets?
    4) Where should I start? Should I start learning Servlets, JSP or Struts2? Any resources?
    5) Do one need to know JSP or Servlets in order to take advantage of Struts2?
    There seems to be very little information for people that jump from PHP to Java for web development. Any advice would be appreciated.... It has been a frustrating experience.
    Edited by: leesiulung on Oct 30, 2008 11:06 AM

    Comments are within (((( ))))) below
    I'm looking into developing a website using either JSP or servlets. However, I have hard time starting due to the difficulty of identifying what I need. I very well versed with Java, but have little experience with JSP or servlets. My knowledge in JSP/Servlets come from reading a book briefly years ago. I have great knowledge of programming and understand web technology. I have programmed dynamic sites in PHP and ColdFusion.
    What I'm trying to accomplish is a site that has the following attributes:
    - create general classes that can be used across multiple sites i.e. database access class etc... (portable code) I intend to start with a small test site, but design it with a larger production web site in mind.
    - prefer if they work with hosting companies (which probably limites me to JSP), but is not a requirement
    - has an easily updated front end i.e. look and feel to site (Struts2 seems to fit this bill). PHP is extremely difficult to update the look and feel of a site. I suspect JSP would be the same....
    I dabbled around with WebSphere and DB2 for a while, but got nowhere since it was rather difficult to get setup and started properly. So here are my questions:
    1) What technology should I at least take a look at before making a decision? (I'm strongly considering JSP + Struts2 + Dojo, but many have recommended Google Web Toolkit)
    (((( first, read a new book on JSP and a book on Servlets to refresh your memory)))))
    2) What web server should I be looking at? (Tomcat, Websphere, JBoss.... I realise that hosting companies probalby use Tomcat)?
    ((((Tomcat is free and easy to use and very widely used. Websphere and JBoss are advanced topics you shouldnt consider now))))
    3) What do people use for small sites that could have been done in PHP, but like the extendability and backwards compatibility of Java? JSP or Servlets?
    ((((Use MVC (model view controlller) archtecture. You can use a central servlet to take in all url requests and dispatch to the appropriate jsp. Then you can use a framework such as Struts2 or Spring as an alternative to the cental servlet.
    4) Where should I start? Should I start learning Servlets, JSP or Struts2? Any resources?
    ((( JSP first, Then servlets, then JDBC, then Struts or Spring))))
    5) Do one need to know JSP or Servlets in order to take advantage of Struts2?
    (((Yes, Struts and Spring uses JSP. I suggest using a central servlet project first to learn servlets well before messing with a framework))))
    There seems to be very little information for people that jump from PHP to Java for web development. Any advice would be appreciated.... It has been a frustrating experience.
    (((( In MVC, use DAO layer for database access. Refactor your MVC design over and over to refine it)))))
    Edited by: leesiulung on Oct 30, 2008 11:06 AM

  • Struts2 and JSP

    Hi All,
         I am new to the struts2 concept but have to do a project in struts2 and jsp wherein all the user data from a textarea on a jsp page has to be stored in a file(doc, pdf or txt) on the users system using struts2. Can anyone please help me out with a sample code for it?
    Thank You in advance.

    An old fashioned way to add dynamic  sorting is to use a group on a variable that reverses the letters of the text values depending on which column and whether user chooses Ascending or Descending.  Does not even need SDK.  The HTML export can be done using report parts but will not do well for full complex reports.
    We provide  both these features in our Dashboard Launch product seen on the Ecohub
    http://ecohub.sdn.sap.com/irj/ecohub/solutions/dashboardlaunch
    thanks
    Kevin

  • Struts2 WAR giving error when running on WebLogic 10.3.5

    Hi All,
    I have created a Struts2 web application in Eclipse in Windows. I tested it in Eclipse with Tomcat, it ran fine.
    THen I exported it as a WAR file.
    THen I started WebLogic 10.3.5 server from command prompt and deployed this WAR file through WebLogic console. Deployment was successful.
    When, I try to run this application from browser, I get error on WebLogic console as well as on the browser.
    Please find below both the errors:
    WebLogic Console Error in Command Prompt window:
    <Sep 12, 2012 8:02:00 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
    <Sep 12, 2012 8:02:00 PM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
    <Sep 12, 2012 8:03:33 PM IST> <Warning> <Socket> <BEA-000402> <There are: 5 active sockets, but the maximum number of socket reader threads allowed by the configuration is: 4. You may want to alter your configuration.>
    <Sep 12, 2012 8:04:19 PM IST> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher.
    Unable to load configuration. - bean - zip:C:/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/SAP_Connection_Test_Struts/mvzwfg/war/WEB-INF/lib/struts2-core-2.3.1.2.jar!/struts-default.xml:29:72
         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:449)
         at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:195)
         at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:332)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         Truncated. see log file for complete stacktrace
    Caused By: Unable to load configuration. - bean - zip:C:/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/SAP_Connection_Test_Struts/mvzwfg/war/WEB-INF/lib/struts2-core-2.3.1.2.jar!/struts-default.xml:29:72
         at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
         at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
         at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:195)
         at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:332)
         Truncated. see log file for complete stacktrace
    Caused By: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - zip:C:/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/SAP_Connection_Test_Struts/mvzwfg/war/WEB-INF/lib/struts2-core-2.3.1.2.jar!/struts-default.xml:29:72
         at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:235)
         at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
         at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:180)
         at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
         at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
         Truncated. see log file for complete stacktrace
    Caused By: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file:/C:/Oracle/Middleware/user_projects/domains/base_domain/lib/struts2-core-2.3.1.2.jar!/struts-default.xml:29:72 - bean - zip:C:/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/SAP_Connection_Test_Struts/mvzwfg/war/WEB-INF/lib/struts2-core-2.3.1.2.jar!/struts-default.xml:29:72
         at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:219)
         at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
         at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:180)
         at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
         at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
         Truncated. see log file for complete stacktrace
    >
    <Sep 12, 2012 8:04:24 PM IST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=WebAppApplicationOverviewPage&WebAppApplicationOverviewPortlethandle=com.bea.console.handles.AppDeploymentHandle%28%22com.bea%3AName%3DSAP_Connection_Test_Struts%2CType%3DAppDeployment%22%29.>
    <Sep 12, 2012 8:04:39 PM IST> <Error> <HTTP> <BEA-101020> <[ServletContext@17395825[app:SAP_Connection_Test_Struts module:SAP_Connection_Test_Struts.war path:/SAP_Connection_Test_Struts spec-version:2.5]] Servlet failed with Exception
    The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
         at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)
         at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)
         at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)
         at jsp_servlet.__login._jsp__tag0(__login.java:117)
         at jsp_servlet.__login._jspService(__login.java:86)
         Truncated. see log file for complete stacktrace
    >
    Error in Browser Window:
    Error 500--Internal Server Error
    The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
         at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)
         at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)
         at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)
         at jsp_servlet.__login._jsp__tag0(__login.java:117)
         at jsp_servlet.__login._jspService(__login.java:86)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:416)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:326)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3714)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    I am using following Struts2 jar files:
    commons-fileupload-1.2.1.jar
    commons-io-1.3.2.jar
    commons-lang-2.4.jar
    commons-logging-1.0.4.jar
    commons-logging-api-1.1.jar
    freemarker-2.3.18.jar
    javassist-3.0.jar
    ognl-3.0.4.jar
    struts2-core-2.3.1.2.jar
    xwork-core-2.3.1.2.jar
    Any help would be really appreciated.
    Thanks
    Mohit

    Adding to the question above, following is my 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.enable.DynamicMethodInvocation"
    value="false" />
    <constant name="struts.devMode" value="false" />
    <constant name="struts.custom.i18n.resources"
    value="ApplicationResources" />
    <package name="default" extends="struts-default" namespace="/">
    <action name="login"
    class="struts2.action.LoginAction">
    <result name="success">Welcome.jsp</result>
    <result name="error">Login.jsp</result>
    </action>
    </package>
    </struts>
    ---------------------------------------------------------------------------------------

  • Error in jsp file

    I am facing some issue with the jsp using strut 2.1.8.1
    My Jsp code is
    <%@ page language="java"  pageEncoding="ISO-8859-1"%>  
    <%@ taglib prefix="html" uri="/struts-tags" %>  
    <!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>Onstar Forumz</title>  
    </head>  
    <body bgcolor="#FFFFFF" text="#000000">  
    <%@ include file="/header.jsp" %>  
    <html:form action="UserverifyAction" name="userForm" type="com.onstar.user.in.form.UserForm">  
    <html:text property="username" style="position:absolute;left:720px;top:271px;width:112px;font-family:Arial;font-size:16px;z-index:15" name="username" value="" ></html:text>  
    <html:password property="password" style="position:absolute;left:720px;top:302px;width:112px;font-family:Arial;font-size:16px;z-index:16" name="password" value="" ></html:password>  
    <div id="wb_Username" style="position:absolute;left:631px;top:276px;width:82px;height:16px;z-index:17;" align="left">  
    <font style="font-size:13px" color="#FFFFFF" face="Arial"><b>User name :</b></font></div>  
    <div id="wb_Password" style="position:absolute;left:631px;top:307px;width:82px;height:16px;z-index:18;" align="left">  
    <font style="font-size:13px" color="#FFFFFF" face="Arial"><b>Password   : </b></font></div>  
    <div id="wb_signin" style="position:absolute;left:843px;top:304px;width:101px;height:23px;z-index:19;" align="left">  
    <input type="image" src="images/gold_sign.gif" id="signin" alt="" align="top" border="0" style="width:101px;height:23px;"></div>  
    </html:form>  
    <%@ include file="/footer.jsp" %>  
    </body>  
    </html>Error Message:
    org.apache.jasper.JasperException: /index.jsp(15,0) Attribute property invalid for tag text according to TLD index.jsp is the name of the jsp file.
    I have placed the struts2-core-2.1.8.1.jar in lib folder as well as well I have configured the buildpath with the jar file(struts2-core-2.1.8.1.jar)
    Please help me...Thanks in Advance{                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I think we have a case here of trying to use the Struts1.2 tag libraries in Struts2.0
    The tag libraries are quite different :-)
    I believe the <s:textfield> tag is probably what was intended here?
    Or install struts 1.2 instead of struts2 :-)

  • Can any one help me to download a file using struts2

    can any send me a sample program to download a file using struts2
    regards
    saradhi

    i cannot find it in google please help me by sending a link or a code
    thanking u
    regards saradhi
    while i am executing this code i am getting error
    javax.servlet.ServletException: Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the <param name="inputName"> tag specified for this action.
         org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
         org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    java.lang.IllegalArgumentException: Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the <param name="inputName"> tag specified for this action.
         org.apache.struts2.dispatcher.StreamResult.doExecute(StreamResult.java:189)
         org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
         com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
         com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
         com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
         org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
         com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
         com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
         com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
         com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
         com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
         com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
         org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
         org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
         org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17
    and my code is as follows
    download action.java
    package com.mss.mirage;
    import java.io.InputStream;
    import org.apache.struts2.ServletActionContext;
    import com.opensymphony.xwork2.ActionInvocation;
    import com.opensymphony.xwork2.Action;
    * Demonstrates file resource download.
    * Set filePath to the local file resource to download,
    * relative to the application root ("/images/struts.gif").
    public class FileDownloadAction implements Action {
    private String inputPath;
    private String contentType;
    private String inputName;
    private String contentDisposition;
    private String fileId;
    private int bufferSize;
    public void setInputPath(String value) {
    inputPath = value;
    public InputStream getInputStream() throws Exception {
    return ServletActionContext.getServletContext().getResourceAsStream(getInputPath());
    public String execute() throws Exception {
    return SUCCESS;
    public String getInputPath() {
    return inputPath;
    public String getContentType() {
    return contentType;
    public void setContentType(String contentType) {
    this.contentType = contentType;
    public String getInputName() {
    return inputName;
    public void setInputName(String inputName) {
    this.inputName = inputName;
    public String getContentDisposition() {
    return contentDisposition;
    public void setContentDisposition(String contentDisposition) {
    this.contentDisposition = contentDisposition;
    public String getFileId() {
    return fileId;
    public void setFileId(String fileId) {
    this.fileId = fileId;
    public int getBufferSize() {
    return bufferSize;
    public void setBufferSize(int bufferSize) {
    this.bufferSize = bufferSize;
    download.jsp
    <%@ taglib prefix="s" uri="/struts-tags" %>
    <html>
    <head>
    <title>Showcase - Fileupload</title>
    </head>
    <body>
    <h1>File Download Example</h1>
    <ul>
    <li>
    <s:url id="url" action="download2"/><s:a href="%{url}">Download ZIP file.</s:a>
    The browser should prompt for a location to save the ZIP file.
    </li>
    </ul>
    </body>
    </html>
    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>
    <package name="download" extends="struts-default" namespace="/download">
    <default-action-ref name="download"/>
    <action name="download2" class="com.mss.mirage.FileDownloadAction">
    <param name="inputPath">"c:\images\struts.zip"</param>
    <result name="success" type="stream">
    <param name="contentType">application/zip</param>
    <param name="inputName">inputStream</param>
    <param name="contentDisposition">filename="c:\images\struts.zip"</param>
    <param name="bufferSize">4096</param>
    </result>
    </action>
    </package>
    </struts>

  • Jsp flex chart

    Hello
    I would like to create a horizontal bar chart according to data from a struts2 action class and place the flex chart in a jsp.
    I have already seen code on how to do a horizontal bar chart @ http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=charts_types_109_03.html
    I am watching James Ward's video on java and flex @ http://www.jamesward.com/blog/2008/07/21/video-flex-and-java/
    How do I place the flex graph in my jsp? What kind of flex project/component do I create and where do I place it?
    Appreciate all help.
    Thanks

    Once you compile your Flex app you can size it and embed it anywhere you
    want in your web page.

  • Struts2 and Tiles2 - Error executing tag: Attribute 'title' not found.

    I keep getting Error executing tag: Attribute 'title' not found when I go to the baseLayout.jsp page. I am figuring it is not seeing the tiles.xml file, but I have placed it in the /WEB-INF directory like every web page I have found says too. Any help or pointers would be appreciated.
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Error executing tag: Attribute 'title' not found.
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)I am using maven to load my dependency, so here are the version numbers.
            <dependency>
              <groupId>org.apache.struts</groupId>
              <artifactId>struts2-core</artifactId>
              <version>2.2.1</version>
         </dependency>
         <dependency>
              <groupId>org.apache.struts</groupId>
              <artifactId>struts2-tiles-plugin</artifactId>
              <version>2.2.1</version>
         </dependency>
            <dependency>
              <groupId>log4j</groupId>
              <artifactId>log4j</artifactId>
              <version>1.2.16</version>
         </dependency>
            <dependency>
              <groupId>jboss</groupId>
              <artifactId>javassist</artifactId>
              <version>3.1</version>
         </dependency>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.enable.DynamicMethodInvocation"
              value="false" />
         <constant name="struts.devMode" value="false" />
         <constant name="struts.custom.i18n.resources"
              value="forum" />
         <package name="default" namespace="/" extends="struts-default">
              <result-types>
                   <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
              </result-types>
              <action name="login" class="net.game_tech.LoginAction">
                   <result name="success" type="tiles">/login.success.tiles</result>
                   <result name="error" type="tiles">/login.tiles</result>
              </action>
              <action name="login-form">
                   <result name="success" type="tiles">/login.tiles</result>
              </action>
         </package>
    </struts>web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         id="WebApp_ID" version="2.5">
         <display-name>Forum</display-name>
         <listener>
              <listener-class>
                   org.apache.struts2.tiles.StrutsTilesListener
              </listener-class>
         </listener>
         <context-param>
              <param-name>tilesDefinitions</param-name>
              <param-value>/WEB-INF/tiles.xml</param-value>
         </context-param>
         <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>index.jsp</welcome-file>
         </welcome-file-list>
         <resource-ref>
              <description>Mysql Forum</description>
              <res-ref-name>jdbc/Forum</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
              <res-sharing-scope>Shareable</res-sharing-scope>
         </resource-ref>
    </web-app>tiles.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE tiles-definitions PUBLIC
           "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
           "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
    <tiles-definitions>
         <definition name="baseLayout" template="/baseLayout.jsp">
              <put-attribute name="title" value="Simple Java Forums" />
              <put-attribute name="header" value="/common/Header.jsp" />
              <put-attribute name="menu" value="/common/MenuNav.jsp" />
              <put-attribute name="body" value="" />
              <put-attribute name="footer" value="/common/Footer.jsp" />
         </definition>
         <definition name="/login.tiles" extends="baseLayout">
              <put-attribute name="header" value="/pvt/Login.jsp" />
         </definition>
         <definition name="/login.success.tiles" extends="baseLayout">
              <put-attribute name="header" value="/pvt/Welcome.jsp" />
         </definition>
    </tiles-definitions>baseLayout.jsp
    <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
    <!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" xml:lang="en" lang="en">
    <head>
         <title><tiles:insertAttribute name="title" /></title>
         <link href="css/main.css" rel="stylesheet" type="text/css" media="all"/>
    </head>
    <body>
         <div id="page">
              <tiles:insertAttribute name="header" />
              <tiles:insertAttribute name="menu" />
              <tiles:insertAttribute name="body" />
              <tiles:insertAttribute name="footer" />
         </div>
    </body>
    </html>

    I was playing around with it some more and was trying to follow this page:
    http://www.vaannila.com/struts-2/struts-2-example/struts-2-tiles-example-1.html
    I made sure I had the same jar versions. I still get the same exception in the Browser, but I get a few more log messages in the tomcat log;
    Obviously I have something configured wrong. I'll see what searching brings up, and of course any help would be appreciated.
    2010-08-24 10:30:59,885 DEBUG com.opensymphony.xwork2.config.ConfigurationManager.debug:57 - Checking ConfigurationProviders for reload.
    2010-08-24 10:30:59,920 DEBUG com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler.debug:57 - Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@4ba76eff], property=struts]
    2010-08-24 10:30:59,956 WARN  com.opensymphony.xwork2.ognl.OgnlValueStack.warn:45 - Could not find property [struts.actionMapping]
    2010-08-24 10:30:59,957 DEBUG com.opensymphony.xwork2.config.ConfigurationManager.debug:57 - Checking ConfigurationProviders for reload.
    2010-08-24 10:30:59,967 DEBUG com.opensymphony.xwork2.config.ConfigurationManager.debug:57 - Checking ConfigurationProviders for reload.
    2010-08-24 10:30:59,969 DEBUG com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler.debug:57 - Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@4ba76eff], property=org]
    2010-08-24 10:30:59,969 WARN  com.opensymphony.xwork2.ognl.OgnlValueStack.warn:45 - Could not find property [org.apache.catalina.jsp_file]
    2010-08-24 10:31:00,089 DEBUG com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler.debug:57 - Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@4ba76eff], property=org]
    2010-08-24 10:31:00,089 WARN  com.opensymphony.xwork2.ognl.OgnlValueStack.warn:45 - Could not find property [org.apache.tiles.servlet.context.ServletTilesRequestContext.CURRENT_CONTAINER_KEY]
    2010-08-24 10:31:00,099 DEBUG com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler.debug:57 - Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@4ba76eff], property=org]
    2010-08-24 10:31:00,100 WARN  com.opensymphony.xwork2.ognl.OgnlValueStack.warn:45 - Could not find property [org.apache.tiles.AttributeContext.STACK]
    2010-08-24 10:31:00,100 DEBUG com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler.debug:57 - Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@4ba76eff], property=org]
    2010-08-24 10:31:00,100 WARN  com.opensymphony.xwork2.ognl.OgnlValueStack.warn:45 - Could not find property [org.apache.tiles.AttributeContext.STACK]
    Aug 24, 2010 10:31:00 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    org.apache.tiles.jsp.taglib.NoSuchAttributeException: Attribute 'title' not found.

  • Dynamic row in STRUTS2

    dear java,
    Help needed for updating an list in jsp with values added as dynamic row in STRUTS2.
    I have a table displaying data from list (<s:iterator>). It displays 2 rows. I have a button which on clicks added one more row.. blank row (consists, textfields).. in which data is added. now on submit, i need to update list.
    Any help would be much appreciated!

    tnx friend.,
    anyway i got the result.
    instead of using <s:textfield name="textFields[0]" />, i have replaced for (within JS method)
    <input type='text' name='locationId[" + num + "]' value='' id='dyamicRowAction_locationId_" + num + "_'/>
    (its actual replacement html tag for S2 tag - get it from view source ).

  • Cant display index.jsp page of application folder

    Hello experts,
    I am trying to do one simple struts application using Struts2 get the data and display it..
    I kept my folder that is Struts2Application in webbaps dir of tomcat..
    when I write the "http://localhost:8080/Struts2Application" it displays the same page i.e. home page of tomcat, it dosnt show the index.jsp
    and when I write the "http://localhost:8080/Struts2Application/index.jsp" then also displays the home page of tomcat..
    my web.xml is
    <?xml version="1.0" encoding="iso-8859-1"?>
    <web-app id="WebApps_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoacation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>Struts 2 applicaion</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>
         <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
         </welcome-file-list>
    </web-app>Please help me out.....

    Please check out following all files...
    index.jsp
    <%@ page contentType="text/html; charset=UTF-8"%>
    <%@ taglib prefix="s" uri="struts-tags" %>
    <html><head><title>Struts 2 Application</title>
              <link rel="stylesheet" href="mystyle.css" type="text/css" />
         </head>
         <body>
         <h1> Struts 2 Applicaton</h1>
         Enter Client Details :
              <s:form action="ClientAction" method="post">
                   <s:textfield label="Name" name="name"/>
                   <s:textfield label="Age" name="age"/>
                   <s:textfield label="Salary" name="salary"/>
                   <s:submit/>
              </s:form>
         </body>
    </html>client.jsp
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ taglib prefix="s" uri="/struts-tags" %>
    <html>
         <head>
              <title>You submitted </title>
         </head>
         <body>
              Thank you, <b><s:property value="name"/></b>
              your salary is : <b><s:property value="salary"/> $</b>
         </body>
    </html>error.jsp
    <%@ page contentType="text/html; charset=UTF-8"%>
    <%@ taglib prefix="s" uri="struts-tags" %>
    <html>
         <head>
              <title>Struts 2 Application</title>
              <link rel="stylesheet" href="mystyle.css" type="text/css" />
         </head>
         <body>
         <h1> Error..! </h1>
         This error page is being shown because any of following reasons :
         <ul class="boldred">
         <li>Filed(s) left blank.</li>
         <li>Invalid Data Entered.(For examples: String in place of Integer.)</li>
         </ul>     
    </body>
    </html>struts.xml
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
         <include file="struts-default.xml"/>
         <package name="default" extends="struts-default">
              <action name="ClientAction" class="com.kogent.action.ClientAction">
                   <result name="success">/client.jsp</result>
                   <result name="error">/error.jsp</result>
                   <result name="input">/error.jsp</result>
              </action>
         </package>
    </struts>ClientAction.java
    // Java Document
    package com.kogent.action;
    import com.opensymphony.xwork2.*;
    import com.opensymphony.xwork2.ActionSupport;
    public class ClientAction extends ActionSupport
         String name;
         int age;
         int salary;
         public String getName()
              return name;
         public void setName(String name)
              this.name = name;
         public int getAge()
              return age;
         public void setAge(int age)
              this.age = age;
         public int getSalary()
              return salary;
         public void setSalary(int salary)
              this.salary = salary;
         public String execute() throws Exception
              if(getName().equals("") || getName()==null || getAge()==0 || getSalary()==0)
                   return ERROR;
              else
                   return SUCCESS;
    }And I kept all jar files in lib folder of WEB-INF

  • Crystal Report Images Not Showing - JSP inside /WEB-INF folder

    Hi Experts,
    I am using Crystal report for Eclipse and also using Struts2 and tiles framework combination.
    The problem is when viewing the report all I've got is red X on all images and the graph image also not showing. This is when I use tiles and my jsp is inside the web-inf folder.
    This is my struts link: href="s:url value='/report/reportOpen.action?report=1'
    I've checked that the path to the viewer generated HTML is not correct. see code below.
    src="../../../crystalreportviewers/js/crviewerinclude.js"
    But when I test to access a simple jsp viewer that resides on the web root folder, this works fine but of course this is not what I want to have. I need to have my banner and menus on top of the report page (using tiles)
    This is my jsp link: href="s:url value='/ReportViewer.jsp?report=1'
    Viewer generated HTML below.
    src="crystalreportviewers/js/crviewerinclude.js"
    This might be a common problem and that you can share to me your solution.
    Note: I removed the script tags because I can't submit this entry.
    Thank you  in advance,
    Regards,
    Rulix Batistil
    Crystal Report Images Not Showing - JSP inside /WEB-INF folder

    Hi Saravana,
    After a few experimentation from your idea i was able to figure out the problem and now it is working.
    I don't have to copy the folder to where my jsp resides but still maintains it in the root location:  web/crystalreportviewers
    The changes should always be in web.xml.
    1st: change the crystal_image_uri value to ../crystalreportviewers
    2nd: change crystal_image_use_relative value to "web"
    Change to "web" instead of webapp because that is what I named my web root folder.
    <context-param>
              <param-name>crystal_image_uri</param-name>
              <param-value>../crystalreportviewers</param-value>
         </context-param>
         <context-param>
              <param-name>crystal_image_use_relative</param-name>
              <param-value>web</param-value>
         </context-param>
    Thank you. You showed me the way on how to solve the 3 day problem.
    BTW, my next problem is when clicking on any buttons prev/next/print/export, I got this error HTTP Status 404.
    Well, at least for now I can view my initial report.  I just need to figure out the next issue and with the help of the great people here in the forum.
    Thanks a lot.
    Regards,
    Rulix
    Edited by: Rulix Batistil on Nov 26, 2008 7:27 AM

  • Can't get EntityManager access in JSP/Servlet

    Hi all,
    our team has started a EJB project (EJBs + JPA configurations)
    we managed to access the configured JPA (EntityManager etc) within the EJB instance; however we don't know how to access the EntityManager within JSP/Servlet
    Our project's structure:
    1 EJB project (EJB classes, EntityBean classes, JPA configuration + eclipselink)
    1 Web project (for JSP, Servlets)
    the main problem is ... we can't access EntityManager(s) in JSP / Servlets (and we already tried using Struts2.0 to replace servlets/jsp... the problem is the same... so it is not ... the matter of choosing the view technology...)
    Jason

    Hi Jason,
    How i tried to get EntityManager is as following:
    Suppose I want to define my Persistence unit like Following:
    *<Your-EAR>/APP-INF/classes/MyEmployee.java*
    "*MyEmployee.java*"
    package entityA;
    import java.io.Serializable;
    import org.apache.commons.lang.builder.EqualsBuilder;
    import org.apache.commons.lang.builder.HashCodeBuilder;
    import org.apache.commons.lang.builder.ToStringBuilder;
    import javax.persistence.*;
    @Entity()
    @Table(name="MYEMPLOYEE")
    public class MyEmployee implements Serializable {
         //default serial version id, required for serializable classes.
         private static final long serialVersionUID = 1L;
         private Long empno;
         private String empname;
    public MyEmployee() {
         @Id()
         @Column(name="EMPNO", unique=true, nullable=false, precision=22)
         public Long getEmpno() {
              return this.empno;
         public void setEmpno(Long empno) {
              this.empno = empno;
         @Basic()
         @Column(name="EMPNAME", length=15)
         public String getEmpname() {
              return this.empname;
         public void setEmpname(String empname) {
              this.empname = empname;
         public boolean equals(Object other) {
              if (this == other) {
                   return true;
              if (!(other instanceof MyEmployee)) {
                   return false;
              MyEmployee castOther = (MyEmployee)other;
              return new EqualsBuilder()
                   .append(this.getEmpno(), castOther.getEmpno())
                   .isEquals();
         public int hashCode() {
              return new HashCodeBuilder()
                   .append(getEmpno())
                   .toHashCode();
         public String toString() {
              return new ToStringBuilder(this)
                   .append("empno", getEmpno())
                   .toString();
    And I have Placed My "*persistence.xml*" file in *"<Your-EAR>/APP-INF/classes/META-INF/persistence.xml"*
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
         version="1.0">     
         <persistence-unit name="JPA_A_EJB" transaction-type="RESOURCE_LOCAL">
              <provider>org.hibernate.ejb.HibernatePersistence</provider>
              <class>entityA.MyEmployee</class>
              <properties>
                   <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
                   <property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
                   <property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
                   <property name="hibernate.connection.username" value="jack"/>
                   <property name="hibernate.connection.password" value="password"/>
              </properties>
         </persistence-unit>     
    </persistence>
    ***********************************HOW I Access The Above Unit from my EJB mentioned Below*******************************
    "*EmployeeSessionBean.java*"
    package sfsbA;
    import entityA.*;
    import javax.ejb.*;
    import javax.persistence.*;
    @Stateless
    public class EmployeeSessionBean implements EmployeeSessionRemoteIntf
    *@PersistenceContext*
    protected EntityManager entityManager;
    *///NOTE: Using the Above Technique You can access the "EntityManager" Object in your Servlets As well...Just write the Above two Lines inside your Servlet*
    public void createEmployee(Long empno,String empname) throws Exception{
              System.out.println("\n\tcreateEmployee() called. EntityManager entityManager = "+entityManager);
              MyEmployee employee = new MyEmployee();
    employee.setEmpno(empno);
    employee.setEmpname(empname);
    entityManager.persist(employee);
              System.out.println("\n\t Entity Manager has persisted the Employee Information...");
    int count = 0;
    public EmployeeSessionBean() {
    System.out.println("\n\t EmployeeSessionBean--> EmployeeSessionBean() invoked");
    @Init("create")
    public void initMethod() throws CreateException {
    System.out.println("\n\t EmployeeSessionBean--> public void initMethod() invoked");
    @Remove(retainIfException=true)
    public void removeWithRetain() throws Exception{
    System.out.println("\n\t EmployeeSessionBean--> removeWithRetain() invoked");
    @Remove
    public void removeWithoutRetain() throws Exception{
    System.out.println("\n\t EmployeeSessionBean--> removeWithoutRetain() invoked");
    public String printRemoteIntf () {
    System.out.println("\n\t EmployeeSessionBean ---> public String printRemoteIntf () invoked");
         return "ReplicableSFSRemoteObjectIntf";
    public String printLocalIntf () {
    System.out.println("\n\t EmployeeSessionBean ---> public String printLocalIntf () invoked");
         return "ReplicableSFSLocalObjectIntf";
    public String printBean () {
    System.out.println("\n\t EmployeeSessionBean ---> public String printBean () invoked");
         return "EmployeeSessionBean";
    public int testIncrement() throws Exception
    System.out.println("\n\t EmployeeSessionBean ---> public int testIncrement() invoked");
    count=count+5;
    return count;
    public int testDecrement() throws Exception
    System.out.println("\n\t EmployeeSessionBean ---> public int testDecrement() invoked");
    count=count-2;
    return count;
    public int getCount() throws Exception
    System.out.println("\n\t EmployeeSessionBean ---> public int getCount() invoked");
    return count;
    "*EmployeeSessionRemoteIntf.java*"
    package sfsbA;
    public interface EmployeeSessionRemoteIntf {
    public void createEmployee(Long emono,String empname)     throws Exception;
    public void removeWithRetain()throws Exception;
    public void removeWithoutRetain() throws Exception;
    public String printBean ();
    public int testIncrement() throws Exception;
    public int testDecrement() throws Exception;
    public int getCount() throws Exception;
    *"ejb-jar.xml"*
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
    <enterprise-beans>
    <session>
    <ejb-name>EmployeeSessionBean</ejb-name>
    <business-remote>sfsbA.EmployeeSessionRemoteIntf</business-remote>
    <ejb-class>sfsbA.EmployeeSessionBean</ejb-class>
    <session-type>Stateless</session-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    *"weblogic-ejb-jar.xml"* (I am writing these file Just because i want my Own JNDI Simple name...Not the Container Generated Complex JNDI name)
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>EmployeeSessionBean</ejb-name>
    <stateless-session-descriptor>
         <business-interface-jndi-name-map>
    <business-remote>sfsbA.EmployeeSessionRemoteIntf</business-remote>
    <jndi-name>EmployeeSessionBean</jndi-name>
         </business-interface-jndi-name-map>
    </stateless-session-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    "*application.xml*"
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
    <application>
    <display-name>JPAs_Demo_Jason</display-name>
    <module>
    <ejb>AccessEntityManager.jar</ejb>
    </module>
    </application>
    NOTE: The Jar "" Contains
    1). EmployeeSessionBean
    2). EmployeeSessionRemoteIntf
    3). META-INF/ejb-jar.xml
    4). META-INF/weblogic-ejb-jar.xml
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com  (Real WebLogic Stuff...Not less Than a Magic...Here)
    Edited by: Jay SenSharma on Dec 16, 2009 10:59 PM
    Edited by: Jay SenSharma on Dec 16, 2009 11:00 PM

Maybe you are looking for

  • Select from a table from other schema

    Hi, I want to make a select from a table how is into other Schema and into other instance. form example, if I have _2 schemas (in diferent instances)_: SCHEMA1 = *(DESCRIPTION =* *(ADDRESS =* *(PROTOCOL = TCP)* *(HOST = XXX.XXX.XXX.XX1)* *(PORT = 156

  • How do I get signal from my Roland Fantom G8 to Logic Studio or GarageBand?

    My computer recently crashed, and since then I have not been able to record any music into either Logic Studio or GarageBand.  I need to get back up and running ASAP, as I'm in the middle of recording music for 5 different projects.  Here's all the g

  • SAP QM MM overview

    hi Gurus, Actually i am learning SAP QM Module module  and i maintain Creation  Material  - QM view Creation of Quality Information Record Change of Quality Information Record Create Inspection Method Create Master Inspection Characteristic Creating

  • Table for conversion of logical system

    HI All please let me know the table name which will have all source system converion list. thanks in advance. thx vij

  • Plz see this code

    rs=stm.executeQuery("select news.news_id,to_char(news_date,'dd-MON-yy HH:MM:SS AM'),heading,desc1,desc2 from news where sysdate<=news_date + interval '2' day order by news_date desc");           while(rs.next()){           newsDate=rs.getString("news