Sharing a Struts application among portlets

I've written Struts applications before, but I'm new to portlets. I've read that there are two general approaches to portlet UI design. The first is when the user clicks on something in one portlet and a page of results or details displays in another portlet. In other words, "programmatic messaging provides for a particular user interface model, allowing an application to be delivered as a set of communicating portlets." The second approach is to do a wizard of pages within one portlet. "In contrast to the multiple portlet application user-interface model, the other dominant application UI style involves a single portlet that transitions through multiple 'screens'. This 'wizard' style of application interface can be complex to build without some sort of application framework. A popular framework for creating multiple screen Web applications, based on the Model-View-Controller (MVC) pattern, is Struts."
My customer wants the application I'm to write to be integrated in their existing Oracle portal (10g but has to be backwards compatible with 9i). In a non-portlet Struts app, the requirements are pretty straight forward. I need a text input with a search button, about 10 navigation links and a label indicating to the user whether they are browsing or managing along with a dropdown that lets them toggle between browsing and managing and updates the label indicating their current mode. Those three areas (search, navigation, and mode toggle) will display on the left side of the page. The results of the search and the results of clicking on a navigation link should display on the right side of the page and the navigation link results will need to be in wizard form (fill out some fields and click Next, fill out some more fields and click Save). When a user changes their mode on the left side of the screen, the area containing the search results or navigation wizards on the right side of the screen will be updated to include some additional information. The twist (given that I've never written a portlet before and don't know if this is possible) is that the search should be in its own portlet, the navigation links and mode toggle should be in their own portlet and the area where the results of the search or navigation wizard pages display should be its own portlet.
In non-portlet Struts land, the search, navigation, mode toggle, and results would all be part of the same Struts app. Can I write one Struts app and refer to the appropriate pages within that one Struts app for each of my portlets, in essence sharing a Struts app between multiple portlets? Or am I thinking about this all wrong?

Karen,
You can easiliy create several portlets out of a Struts application. For detailed instructions, refer to the Struts section of the Portal Developer's Guide.
Good luck,
Peter

Similar Messages

  • Sharing a single session among multiple portlets for single application (e.g. wInsight)

    Does anyone know the best practices way for sharing a single Session for an application (running on a single Porlet server) among multiple portlets on a page?
    For example, the application wInsight uses 3 frames (navigation, search results - tabular, search results - chart) which need to communicate via the application's session scope. It is not just that we do not want for a single user to be running multiple sessions, but they really do share variable parameters this way.
    So far I can only think of trying to build a one true portlet and two empty containers on page load. I would use the portlet to establish the session with the Portlet server and then transfer the session information to the other two empty containers to instantiate their respective portlets. I haven't tried this yet, but will do so soon...
    Any help and feedback would be greatly appreciated.

    Karen,
    You can easiliy create several portlets out of a Struts application. For detailed instructions, refer to the Struts section of the Portal Developer's Guide.
    Good luck,
    Peter

  • How to call a struts application in a portlet

    How to call a struts application in a portlet. I have two different ear's. In one ear I have my struts application and in one war i have a struts portlet. In the struts portlet provider.xml defaultAction tag can i call the action class .do which in other ear (ie my struts application ear).Can anyone suggest me whether this is the right way or else can u suggest me with some other thing.
    Waiting for ur responses.
    Thanks and Regards,
    Dhanu.

    Hi Dhanu,
    Your Struts Portlet will not be avialble via a URL as it is completely dependent on Oracle Portal Environment. The Provider for the Portlet is alone available via a URL - you would have registered your Portlet using the URL of the Provider.
    Your Struts application, which does not rely on the Oracle Portal Environment, is defeitely accessible from a URL. It's just another web application that uses the popular Struts Framework.
    Hence, you can use the URL ( the starting point - a JSP, Servlet, etc. ) of your Struts Application to "call" the application in your Struts Portlet. I don't think you need to fiddle with the parameters in Provider.xml.
    Moreover, <defaultAction> in Provider.xml should have the URL of a Struts Action Class - the mapping in the
    struts-config.xml should map the .do action to the right JSP file.
    You can have a look at Metalink Note : 331069.1 for a good insight into the <defaultAction> Tag.
    Regards,
    Sandeep

  • Calling struts application within a portlet

    Can anyone explain step wise procedure to call struts application within a portlet.or refer any tutorial for this.

    Amir,
    this might be because you are using the plain struts taglibs. you should use the pdk-struts taglibs. more specifically, you should use the pdk-struts-html taglib instead of the struts-html lib, as the latter renders URLs for a struts application whereas you need portal-enabled urls, which are provided by the pdk-struts-html lib.
    You can either change the taglib reference in your web.xml file to map the plain sruts-html.tld to the pdk-struts-html.tld (don't forget to include it and its jarfile in your deployment file), or you can add the library to every jsp page and replace the <html:whatever> tags by <pdk-html:whatever> tags. (or your other favourite prefix).
    Regards,
    Benjamin

  • PDK-Struts Application requires pdkstruts.jar & pdk-struts-html.tld

    Hi All,
    Scenario is this, that I've created a pdk-struts application via JDeveloper with normal struts taglibs, and deployed it to Oracle Portal 10.1.4. default-action tags specified action.do is working fine and displays the welcome page within portlet region but after clicking any button within that welcome page opens a new browser page within same window and the URL pattern changes too.
    I want this to be executed within portlet region.
    Another problem is this, when I tried to use pdk-struts-html.tld within application;
    first warning within JDeveloper is this; Metadata Namespace for pdk-struts-html is not loaded, all entries are fine, and within Portal after successful deployment it gives an error (500 Server Listener Error) on viewing that portlet body.
    I want these issues to be resolved as soon as possible.
    Or if anybody knows about pdkstruts.jar and pdk-struts-html.tld with latest versions, plz do tell me the site-url to download these things.
    Plz help me out about these issues.
    Thanks in advance.

    Look in the Building Struts Portlets with Oracle Jdevelper section of the Oracle Application Server Portal Developers Guide. You need additional jar files besides the pdkstruts one. Also, look in the server logs to see more detailed messages about why it failed, it will help you debug.

  • Error in Struts Application, Form Submit

    I've developed a simple struts application which allows user to key in inputs thru a form(registration.jsp), submit n display e inputs keyed in in another page(details.jsp).
    i'd succesfully integrate e pdk-struts application to portal, but wen i click on 'Submit', my action r not performed, not directed to my details.jsp, neither do it shows any error.
    However, one thing i realised is tat wen integrated to portal, e codes for my action r changed:
    registration.jsp
    <html:form action="/register" focus="name">
    after integrated wit Portal, it was translated to:
    <form name="registerForm" method="post" action="http://smeagel:7778/portal/page">
    <INPUT TYPE="hidden" name="_pageid" value="6,3,6_22" />
    <INPUT TYPE="hidden" name="_dad" value="portal" />
    <INPUT TYPE="hidden" name="_schema" value="PORTAL" />
    <INPUT TYPE="hidden" name="_piref6_108279_6_3_22.strutsAction" value="register.do" />
    After Submit button was clicked, i was directed to a new URL, http://smeagel:7778/portal/page
    Any solutions??

    provider.xml
    <?xml version = '1.0' encoding = 'UTF-8' standalone='yes'?>
    <?providerDefinition version="3.1"?>
    <provider class="oracle.portal.provider.v2.DefaultProviderDefinition">
    <session>true</session>
    <passAllUrlParams>true</passAllUrlParams>
    <portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
    <id>1</id>
    <name>MyPortlet</name>
    <title>- Registration Form -</title>
    <description>My Portlet Description</description>
    <timeout>40</timeout>
    <showEditToPublic>false</showEditToPublic>
    <hasAbout>false</hasAbout>
    <showEdit>false</showEdit>
    <hasHelp>false</hasHelp>
    <showEditDefault>false</showEditDefault>
    <showDetails>false</showDetails>
    <inputParameter class="oracle.portal.provider.v2.DefaultParameterDefinition">
    <name>MyParam</name>
    <displayName>My Portlet Parameter</displayName>
    </inputParameter>
    <renderer class="oracle.portal.provider.v2.render.RenderManager">
    <renderContainer>true</renderContainer>
    <renderCustomize>true</renderCustomize>
    <autoRedirect>true</autoRedirect>
    <contentType>text/html</contentType>
    <showPage>/registration.jsp</showPage>
    <showPage class="oracle.portal.provider.v2.render.http.StrutsRenderer">/register.do</showPage>
    </renderer>
    </portlet>
    </provider>
    I'd saw some example, which using <defaultAction>, however, wen i put in <defaultAction>/register.do</defaultAction>
    i'll have error in my Provider Test Page. Validation Unsuccessful.
    Error: Class oracle.portal.provider.v2.render.http.StrutsRenderer has no set or add method for tag "defaultAction"
    Is <defaultAction> a necessary tag? Is tat e reason y my application isnt running?

  • ALBPM5.7: Using ALUI with struts application??

    I have a fully functional struts application that uses PAPI to interact with ALBPM5.7. Now I want to Expose all UI screens on the portal server. This need not be portlets, rather using ALUI framework/ EDK to wrap the UI JSPs and expose them in our portal
    Can I reuse my Struts Application with ALUI in some way.
    Thanks.
    Edited by [email protected] at 12/11/2007 9:49 PM

    Ravinder,
    Yes, of course you can bring your struts web application on ALUI portal as a portlet.In general, any web application running either on remote server or ALUI server can be brought up to the ALUI portal.
    If your Struts application is running on the remote server ,here is the steps to view this application on ALUI Portal :
    Login to your ALUI admin ( http://<hostname>:<portnumber >/portal/server.pt(like http://yh759.yashind.com:7001/portal/server.pt) with Administrator as userid(no password required by default)
    Create a Remote server in ALUI where you need to have the info of your Struts application server info
    Create a remote webservice for portlet
    Create a portlet out of that remote webservice
    Put this portlet on any page.
    Alo you can find the online help on ALUI admin conosle for doing all the above steps.
    Thanks
    Bishnu
    Regards
    Bishnu

  • What is the best approach to portalize a struts application to oracle porta

    Hey guys,
    what is the best approach to portalize a struts application to oracle portal... would it by created PDK Portlets or JSR 168 portlets... and is there any direction to do so... can some one please him this girl in need...

    HELLO!!! WELCOME BACK!! I THINK YOU SHOULD USE
    deploy....Hey Thanks.
    is there any network congestion OR any other problem that i can anticipate before i use "deploy" utility. I have heared of some problems(i couldn't remember them now ....because honestly, i couldn't understand them atall when a BEA consultant told me those...).
    so, any problem that may arise ....that i need to think about before deploying ~10 applications to like ~70-80 clusters ....all at a time.
    thanks again for your advise. iam learning to see the big picture of application deployment.
    -sangita

  • Integrating an existing struts application

    Sorry if this has been discussed before but I tried searching the newsgroup with
    no success. tia.
    I am trying to integrate the struts application found in the struts-example.war
    file that I extracted from the jakarta-struts-1.1.zip file from jakarta.apache.org.
    (I have successfully deployed and tested this war file to the weblogic server
    so I know the application works.)
    I unzip the war file into a temp directory and follow the instructions found in
    "e-docs.bea.com/workshop/docs81/doc/en/portal/buildportals/appIntegratingStruts.html"
    After creating a struts portlet using the wizard and putting the portlet into
    my test portal, when I try to run the portal using debug in Workshop, I get:
    <Error> <netuix> <BEA-420599> <Unable to perform action [example/begin] for Struts
    module [example]. Please ensure that both module and action are correct.>
    <Error> <netuix> <BEA-420037> <There was an error loading the requested URI /example/mainMenu.jsp.>
    <Error> <netuix> <BEA-423012> <There was an error while running a lifecycle stage
    Lifecycle: UIControl.render :: for the control :: null ::.com.bea.netuix.nf.UIControlException:
    No ActionResult returned for action [example/begin] in Struts module [example].
    Please ensure that both module and action are correct in portlet StrutsContent
    element.
    at com.bea.netuix.servlets.controls.content.StrutsContent.preRender(StrutsContent.java:399)
    at com.bea.netuix.nf.ControlLifecycle$6.visit(ControlLifecycle.java:388)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:619)
    I've tried changing the struts action and content uri with no success. I've tried
    changing the
    struts-auto-config-<module name>.xml file with even less success.
    Help would be greatly appreciated. tia.

    Have anyone got the answer from BEA ...
    I am also having the same problem.
    Pl. post if you have any answers.
    Thanks
    Kicha
    "Julien De Santis-Caron" <[email protected]> wrote:
    >
    Hi,
    I have the same problem and I can't find any way for correcting this.
    Please, help-us with this issue because integration of existing Struts
    applications
    into a portlet is a critical issue for choosing a Portal solution.
    thanks
    Julien De Santis-Caron
    "Dean Saiki" <[email protected]> wrote:
    Sorry if this has been discussed before but I tried searching the newsgroup
    with
    no success. tia.
    I am trying to integrate the struts application found in the struts-example.war
    file that I extracted from the jakarta-struts-1.1.zip file from jakarta.apache.org.
    (I have successfully deployed and tested this war file to the weblogic
    server
    so I know the application works.)
    I unzip the war file into a temp directory and follow the instructions
    found in
    "e-docs.bea.com/workshop/docs81/doc/en/portal/buildportals/appIntegratingStruts.html"
    After creating a struts portlet using the wizard and putting the portlet
    into
    my test portal, when I try to run the portal using debug in Workshop,
    I get:
    <Error> <netuix> <BEA-420599> <Unable to perform action [example/begin]
    for Struts
    module [example]. Please ensure that both module and action are correct.>
    <Error> <netuix> <BEA-420037> <There was an error loading the requested
    URI /example/mainMenu.jsp.>
    <Error> <netuix> <BEA-423012> <There was an error while running a lifecycle
    stage
    Lifecycle: UIControl.render :: for the control :: null ::.com.bea.netuix.nf.UIControlException:
    No ActionResult returned for action [example/begin] in Struts module
    [example].
    Please ensure that both module and action are correct in portlet StrutsContent
    element.
    at com.bea.netuix.servlets.controls.content.StrutsContent.preRender(StrutsContent.java:399)
    at com.bea.netuix.nf.ControlLifecycle$6.visit(ControlLifecycle.java:388)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:619)
    I've tried changing the struts action and content uri with no success.
    I've tried
    changing the
    struts-auto-config-<module name>.xml file with even less success.
    Help would be greatly appreciated. tia.

  • Error while deploying struts application in tomcat

    Hi,
    I'm getting the following error when I start Tomcat using while auto-deploying a struts application.
    2005-09-21 15:28:17 - ContextManager: Adding DEFAULT:/cna
    2005-09-21 15:28:18 - Ctx(/cna) : Validating web.xml
    2005-09-21 15:28:18 - Ctx(/cna) : Class not found: org.apache.struts.action.Acti
    onServlet
    2005-09-21 15:28:18 - Ctx(/cna) : Class not found: org.apache.axis.transport.htt
    p.AdminServlet
    In case anyone is aware how to resolve this issue, please help.
    Thanks,
    Roseline

    Hi,
    1] Remove following from server.xml
    <Context path="/SEA" docBase="SEA" debug="0"/>
    2] Paste SEA.WAR (test WAR file) into /webapps of TOMCAT
    3] Start Tomcat Server - This will create SEA folder under webapps
    4] Stop server.
    5] Add following to server.xml
    <Context path="/SEA" docBase="SEA" debug="0"/>
    6] Start Tomcat Server
    7] Access the URL.
    This will work. Somehow Tomcat does not extract war file contents which are mentioned in server.xml.
    I have Apache Tomcat 4.0.3 and faced this problem. The above solution works for it.
    Regards,
    Sandesh
    hi.
    I have put my SEA.WAR (test WAR file) into /webapps of
    TOMCAT.
    I checked the server.xml and put:
         <Context path="/SEA" docBase="SEA" debug="0"/>
    I restarted TOMCAT and tried to execute the file:
         http://localhost:8080/SEA/index.jsp
    But I got error message:
    Apache Tomcat/4.0.3 - HTTP Status 404 -
    /SEA/index.jsp
    What was happenning?
    Anyone can help me?
    Thank you.

  • Error while deploying struts application

    Hi every body,
    I am new for struts application. While i deploying my application, the following error is comming any body give a remedy to me...
    Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: File "/WEB-INF/struts-html.tld" not found
         at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:214)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
         at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1170)
         at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:765)
         at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:125)
         at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:214)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:534)
    --------------------------------------------------------------------------------

    Hi every body,
    I am new for struts application. While i deploying my
    application, the following error is comming any body
    give a remedy to me...
    Apache Tomcat/4.0.4 - HTTP Status 500 - Internal
    Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error
    (Internal Server Error) that prevented it from
    fulfilling this request.
    exception
    org.apache.jasper.JasperException: File
    "/WEB-INF/struts-html.tld" not found
    at
    t
    org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibr
    aryInfoImpl.java:214)
    at
    t
    org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibr
    aryInfoImpl.java:174)
    at
    t
    org.apache.jasper.compiler.JspParseEventListener.proce
    ssTaglibDirective(JspParseEventListener.java:1170)
    at
    t
    org.apache.jasper.compiler.JspParseEventListener.handl
    eDirective(JspParseEventListener.java:765)
    at
    t
    org.apache.jasper.compiler.DelegatingListener.handleDi
    rective(DelegatingListener.java:125)
    at
    t
    org.apache.jasper.compiler.Parser$Directive.accept(Par
    ser.java:255)
    at
    t
    org.apache.jasper.compiler.Parser.parse(Parser.java:11
    45)
    at
    t
    org.apache.jasper.compiler.Parser.parse(Parser.java:11
    03)
    at
    t
    org.apache.jasper.compiler.Parser.parse(Parser.java:10
    99)
    at
    t
    org.apache.jasper.compiler.ParserController.parse(Pars
    erController.java:214)
    at
    t
    org.apache.jasper.compiler.Compiler.compile(Compiler.j
    ava:210)
    at
    t
    org.apache.jasper.servlet.JspServlet.loadJSP(JspServle
    t.java:548)
    at
    t
    org.apache.jasper.servlet.JspServlet$JspServletWrapper
    .loadIfNecessary(JspServlet.java:176)
    at
    t
    org.apache.jasper.servlet.JspServlet$JspServletWrapper
    .service(JspServlet.java:188)
    at
    t
    org.apache.jasper.servlet.JspServlet.serviceJspFile(Js
    pServlet.java:381)
    at
    t
    org.apache.jasper.servlet.JspServlet.service(JspServle
    t.java:473)
    at
    t
    javax.servlet.http.HttpServlet.service(HttpServlet.jav
    a:853)
    at
    t
    org.apache.catalina.core.ApplicationFilterChain.intern
    alDoFilter(ApplicationFilterChain.java:247)
    at
    t
    org.apache.catalina.core.ApplicationFilterChain.doFilt
    er(ApplicationFilterChain.java:193)
    at
    t
    org.apache.catalina.core.StandardWrapperValve.invoke(S
    tandardWrapperValve.java:243)
    at
    t
    org.apache.catalina.core.StandardPipeline.invokeNext(S
    tandardPipeline.java:566)
    at
    t
    org.apache.catalina.core.StandardPipeline.invoke(Stand
    ardPipeline.java:472)
    at
    t
    org.apache.catalina.core.ContainerBase.invoke(Containe
    rBase.java:943)
    at
    t
    org.apache.catalina.core.StandardContextValve.invoke(S
    tandardContextValve.java:190)
    at
    t
    org.apache.catalina.core.StandardPipeline.invokeNext(S
    tandardPipeline.java:566)
    at
    t
    org.apache.catalina.valves.CertificatesValve.invoke(Ce
    rtificatesValve.java:246)
    at
    t
    org.apache.catalina.core.StandardPipeline.invokeNext(S
    tandardPipeline.java:564)
    at
    t
    org.apache.catalina.core.StandardPipeline.invoke(Stand
    ardPipeline.java:472)
    at
    t
    org.apache.catalina.core.ContainerBase.invoke(Containe
    rBase.java:943)
    at
    t
    org.apache.catalina.core.StandardContext.invoke(Standa
    rdContext.java:2347)
    at
    t
    org.apache.catalina.core.StandardHostValve.invoke(Stan
    dardHostValve.java:180)
    at
    t
    org.apache.catalina.core.StandardPipeline.invokeNext(S
    tandardPipeline.java:566)
    at
    t
    org.apache.catalina.valves.ErrorDispatcherValve.invoke
    (ErrorDispatcherValve.java:170)
    at
    t
    org.apache.catalina.core.StandardPipeline.invokeNext(S
    tandardPipeline.java:564)
    at
    t
    org.apache.catalina.valves.ErrorReportValve.invoke(Err
    orReportValve.java:170)
    at
    t
    org.apache.catalina.core.StandardPipeline.invokeNext(S
    tandardPipeline.java:564)
    at
    t
    org.apache.catalina.valves.AccessLogValve.invoke(Acces
    sLogValve.java:468)
    at
    t
    org.apache.catalina.core.StandardPipeline.invokeNext(S
    tandardPipeline.java:564)
    at
    t
    org.apache.catalina.core.StandardPipeline.invoke(Stand
    ardPipeline.java:472)
    at
    t
    org.apache.catalina.core.ContainerBase.invoke(Containe
    rBase.java:943)
    at
    t
    org.apache.catalina.core.StandardEngineValve.invoke(St
    andardEngineValve.java:174)
    at
    t
    org.apache.catalina.core.StandardPipeline.invokeNext(S
    tandardPipeline.java:566)
    at
    t
    org.apache.catalina.core.StandardPipeline.invoke(Stand
    ardPipeline.java:472)
    at
    t
    org.apache.catalina.core.ContainerBase.invoke(Containe
    rBase.java:943)
    at
    t
    org.apache.catalina.connector.http.HttpProcessor.proce
    ss(HttpProcessor.java:1027)
    at
    t
    org.apache.catalina.connector.http.HttpProcessor.run(H
    ttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:534)
    --------------------------i am try to run struts application. but it shows following error
    org.apache.jasper.JasperException: File "/WEB-INF/struts-html.tld" not found
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  • Console error while deploying a struts application..

    I am getting following exception while deploying a struts application:-
    javax.servlet.ServletException: org/apache/commons/logging/LogFactory
         at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:884)
         at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:848)
         at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:787)
         at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3252)
         at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3197)
         at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3174)
         at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:5647)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:869)
         at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2022)
         at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2063)
         at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
         at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
         at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    please help me out.

    The ServletException is just a wrapper exception which informs about an underlying failure. When interpreting stacktraces,the bottommost root cause parts is the most important part. I assume that it's just a java.lang.ClassNotFoundException on org/apache/commons/logging/LogFactory. In that case, the exception is self-explaining enough. The mentioned class is missing in the classpath. The solution is also obvious: add the mentioned class (or at least, the JAR file with the mentioned class) to the classpath and you're fine. As the package name already hints, you can download it at [http://commons.apache.org/logging].
    For future java.lang.* exceptions please consult 'New to Java' forum. This is unrelated to Java Servlet.

  • Struts application using wsad 5.0 - unable to Run on server

    Hi,
    I m developing a small struts application using WSAD 5.0.
    Here is the code
    index.jsp
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ page
    language="java"
    contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    %>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM WebSphere Studio">
    <META http-equiv="Content-Style-Type" content="text/css">
    <LINK href="theme/Master.css" rel="stylesheet" type="text/css">
    <TITLE>ABC, Inc. Human Resources Portal</TITLE>
    </HEAD>
    <BODY background="F1_100.gif">
    <font size="+1">ABC, Inc. Human Resources Portal </font>
    </br>
    <hr width="100%" noshade="true">
    &#149;Add an Employee
    <br>
    &#149;
    <html:link forward="search">Search for Employees</html:link>
    <br>
    </BODY>
    </HTML>
    search.jsp
    <%@ 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> ABC, Inc. Human Resources Portal - Employee Search</title>
    </head>
    <body>
    <font size="+1">
    ABC, Inc. Human Resources Portal - Employee Search
    </font><br>
    <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>
    searchForm.java
    package minihr.forms;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    * Form bean for a Struts application.
    * Users may access 3 fields on this form:
    * <ul>
    * <li>name - [your comment here]
    * <li>ssNum - [your comment here]
    * </ul>
    * @version      1.0
    * @author
    public class SearchForm extends ActionForm {
         private String name = null;
         private String ssNum = null;
        private List results = null;
          * Get Name
          * @return String
         public String getName() {
              return name;
          * Set Name
          * @param <code>String</code>
         public void setName(String name) {
              this.name = name;
          * Get SsNum
          * @return String
         public String getSsNum() {
              return ssNum;
          * Set SsNum
          * @param <code>String</code>
         public void setSsNum(String ssNum) {
              this.ssNum = ssNum;
          * Set Results
         public void setResults(List results){
              this.results=results;
          * get Results
         public List getResults(){
              return results;
         * Constructor
         public SearchForm() {}
         public void reset(ActionMapping mapping, HttpServletRequest request) {
              // Reset values are provided as samples only. Change as appropriate.
              name = null;
              ssNum = null;
              results = null;
         //validate form data.
         public ActionErrors validate(
              ActionMapping mapping,
              HttpServletRequest request) {
              ActionErrors errors = new ActionErrors();
              // Validate the fields in your form, adding
              // adding each error to this.errors as found, e.g.
              // if ((field == null) || (field.length() == 0)) {
              //   errors.add("field", new ActionError("error.field.required"));
              boolean nameEntered = false;
              boolean ssNumEntered = false;
              //Determine if name has been entered.
              if(name != null && name.length() > 0){
                   nameEntered = true;
              //Determine if social security number has been entered
              if(ssNum != null && ssNum.length() > 0){
                   ssNumEntered = true;
              /* validate that either name or ssnum has
               * been entered */
               if(!nameEntered && !ssNumEntered){
                    errors.add(null,new ActionError("error.search.criteria.missing"));
               /* validate format of ssnum if it has been entered */
               if(ssNumEntered && !isValidSsNum(ssNum.trim())){
                    errors.add("ssNum",
                       new ActionError("error.search.ssNum.invalid"));
              return errors;
         //validate format of social security number
         private static boolean isValidSsNum(String ssNum){
              if(ssNum.length() < 11){
                   return false;
              for(int i=0;i<11;i++){
                   if(i==3 || i==6){
                        if(ssNum.charAt(i) != '-'){
                             return false;
                   }else if("0123456789".indexOf(ssNum.charAt(i)) == -1){
                        return false;
              return true;
    searchAction.java
    package minihr.actions;
    import java.util.ArrayList;
    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 minihr.forms.SearchForm;
    import common.EmployeeSearchService;
    * @version      1.0
    * @author
    public class SearchAction extends Action {
         * Constructor
         public SearchAction() {}
         public ActionForward perform(
              ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response)
              throws Exception {
              EmployeeSearchService service = new EmployeeSearchService();
              ArrayList results;
              SearchForm searchForm = (SearchForm) form;
              //perform employee search based on what criteria was entered
              String name = searchForm.getName();
              if(name != null && name.trim().length() > 0)
                results = service.searchByName(name);
              else
                   results = service.searchBySsNum(searchForm.getSsNum().trim());
              //place search results in searchform for access by JSP.
              searchForm.setResults(results);
              //forward control to this actions input page
              return mapping.getInputForward();
    EmployeeSearchService.java
    package common;
    import java.util.ArrayList;
    import common.Employee;
    * @author Niharika
    * To change this generated comment edit the template variable "typecomment":
    * Window>Preferences>Java>Templates.
    * To enable and disable the creation of type comments go to
    * Window>Preferences>Java>Code Generation.
    public class EmployeeSearchService {
         private static Employee[] employees =
              new Employee("samuel","123-45-6789"),
              new Employee("Robert","234-56-7890"),
              new Employee("smith","345-67-8901"),
              new Employee("Frank","456-78-9012")
         // search for employees by name
         public ArrayList searchByName(String name){
              ArrayList resultList = new ArrayList();
              for(int i=0; i<employees.length; i++)
                   if(employees.getName().toUpperCase().indexOf(name.toUpperCase()) != -1)
                        resultList.add(employees[i]);
              return resultList;
    // search for employee by social security number
    public ArrayList searchBySsNum(String ssNum){
         ArrayList resultList = new ArrayList();
         for(int i=0;     i<employees.length; i++)
              if(int i=0; i<employees.length; i++)
                   if(employee[i].getSsNum().equals(ssNum))
                        resultList.add(employees[i]);
              return resultList;
    Employee.java
    package common;
    * @author Niharika
    * To change this generated comment edit the template variable "typecomment":
    * Window>Preferences>Java>Templates.
    * To enable and disable the creation of type comments go to
    * Window>Preferences>Java>Code Generation.
    public class Employee {
    private String name;
    private String ssNum;
    public Employee(String name,String ssNum)
         this.name=name;
         this.ssNum=ssNum;
    public void setName(String name)
         this.name=name;
    public String getName()
         return name;
    ApplicationResources.properties
    # Label Resources
    label.search.name=Name
    label.search.ssNum=Social Security Number
    # Error Resources
    error.search.criteria.missing=<li>Search Criteria Missing</li>
    error.search.ssNum.invalid=<li>Invalid Social Security Number</li>
    errors.header=<font color="red"><b>Validation Errors </b></font><ul>
    errors.footer=</ul><hr width="100%" size="1" noshade="true">
    In searchAction.java
    it is showing 2 errors
    public ActionForward perform(
              ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response)
              throws Exception {
    error is: Exception Exception is not compatible with throws clause in
    org.apache.struts.action.Action.Perform()
    Another error is shown at :
    return mapping.getInputForward();
    error is:
    method is undefined for typt org.apache.struts.action.ActionMapping
    please give me a solution for this watching the code
    i have opened the server perspective and started the server.
    next i am clicking run on server. There i am getting an error like this:
    Error Received while starting the server
    Reason:
    Launching the server failed:
    server port 9080 is in use.
    ORB bootstrap port 2809 is in use.
    SOAP connector port 8880 is in use.
    change each used port number to another unused port on the ports page of the server configuration editor. In case u have another websphere server running , you can try to increase each used port number by one and try again.please solve this problem

    Nothing at all to do with struts.
    Some of the ports that WSAD wants to use are already in use.
    Maybe you have a copy of websphere running already?
    If so stop that one, and try running again.

  • Error in simple struts application

    Hi friends,
    Happy to meet again. Please help me out from this situation which kills me for the past 1 week. While i try to deploy my first struts application through eclipse 3.2 with jdk1.5 and tomcat 5.5.25 and struts 2.0.9 i'm getting this error. what is this regarding.
    FYI
    I'm just using two text boxes and trying to get those in next page....
    The error goes like this
    exception
    org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.html.MessagesTei
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:281)
         org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:423)
         org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:249)
         org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:163)
         org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
         org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
         org.apache.jasper.compiler.Parser.parse(Parser.java:127)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.lang.ClassNotFoundException: org.apache.struts.taglib.html.MessagesTei
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1362)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208)
         org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:420)
         org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:249)
         org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:163)
         org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
         org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
         org.apache.jasper.compiler.Parser.parse(Parser.java:127)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    See http://forum.java.sun.com/thread.jspa?messageID=3866745&tstart=0

  • Frame issue in jsp/struts application

    I have a problem with jsp struts application .
    i have a jsp page which is inside a frame .
    The action class which receives the request from this page redirects the request to another jsp page.
    I want this new jsp page to be displayed without any frame , but it is getting displayed from inside the frame .
    can anybody help me out ...
    regards,               
    slam

    Possibly:
    1. Browser could be caching the page.
    2. If you use a proxy, the proxy may be caching the page.
    3. The page is not getting recompiled.

Maybe you are looking for