Strut Question

I have a question about struts. I know Strut is good framework for designing a large website. It has a lot of classes that help to design well scaled websites. What about performance? Does it slow the processing of request. if speed is the main issue is it good idea to use strut?if website needs to handle about 200,000
request per hour would you advice to use strut?

You may get more responses in this forum but I thought I'd pass along a struts specific resource that you could also try.
A good source of help on Struts specific questions is the Struts user mailing list at Apache ... it's filled with helpful people, and the archives are a gold mine of good advice. To subscribe, send an empty message to <[email protected]>.

Similar Messages

  • Struts question ?

    hi,
    i am using the struts framework, i have createa my own
    RequestProcessor class in order to check if the user have already loggged on.
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.apache.struts.action.*;
    public class eShoopRequestProcessor extends RequestProcessor {          
    protected boolean processPreprocess(HttpServletRequest request,                                        HttpServletResponse response) {
                   HttpSession session = request.getSession();          
    //the user has already logged on          
    if (session.getAttribute("user") != null)
                   super.processPreprocess(request,response);          
    //the user has to logon          
    else {               
    //forward to login.jsp ?          }                   }}My question is, which is the best way to forward the request to another ressource "/jsps/logon.jsp", have i to use the ServletContext ??? or ActionMappings (how to access the ActionMappings class) ???
    i have also to say that there's a global-forward defined
    in structs-config.xml...
    <global-forwards>       
    <forward name="logon" path="/jsps/logon.jsp">
    </forward>
    </global-forwards>thanks for your answer.

    This is a cross-post:
    http://forum.java.sun.com/thread.jsp?forum=4&thread=439879&tstart=0&trange=15
    It's considered rude. You don't increase your chances of getting an answer when you submit the same question to several forums. It's better to pick the appropriate one and see what happens. If you get no response, THEN it might be considered okay to send it to another forum, as long as you let people know that it's a cross-post and provide a link to the original.
    Have you tried the Struts mailing list? Those folks are pretty responsive, and you're guaranteed to get a knowledgable audience. - MOD

  • JSP, Struts question - novice

    Hi,
    I'm new to Struts and am trying to get the hang of it.
    Here's what I am trying to do.
    In my action class:
    Collection b_list = DM.findAllById();
    request.setAttribute("fields1", b_list);
    Here, DM is a java class and the findAllById method returns an ArrayList. Each item in the array list is lets say of the type: abc(String id, String value) with getId() and getValue() implemented in that class.
    Now in my JSP:
    I do not have a form bean asssociated with it. Infact, I do not want to submit any data from this. I simply want to show a drop down menu box with all items from the collection.
    But I presume I need to create a bean using the object I have added to the request object.
    So, I'm trying to do this: (i dont know if I need property="id" for html:select tag as I dont want to submit anything.
    <logic :p resent parameter="field1">
    <bean :p arameter id="mylist" name="field1"/>
    <html:select property="id">
    <html :o ptionsCollection label="id" name="myList" value="value"/>
    </html:select>
    </logic :p resent>
    OR
    <html :o ptions collection="myList" property="value" labelProperty="id"/>
    instead of html :o ptionsCollections
    Is this correct? I cant get it to work. Am I missing something?
    I do not want to submit any info from this jsp. My jsp (a popup actually) simply uses a javascript function to update something in the previous JSP.
    Also, please note that I am NOT using LabelValueBean and am passing the Collection in the request object and TRYING to create a bean on the fly using the Collection of objects in the JSP.

    I do not have a form bean asssociated with it.
    Infact, I do not want to submit any data from this. I
    simply want to show a drop down menu box with all
    items from the collection.and then do what with the selected value?
    makes no sense to me. (or i'll learn something, too.) put a form in there and send the selection back to the controller servlet. everything from a page has to go back to the controller.
    I do not want to submit any info from this jsp. My
    jsp (a popup actually) simply uses a javascript
    function to update something in the previous JSP.this defeats the purpose of struts and the front controller, if i understand it correctly. that puts page navigation inside pages, and that's exactly what struts is supposed to remove.
    you're not using struts right by doing this, imo.
    %

  • Urgent:Struts question

    Hi,
    I am working on a web application using struts framework. I know Struts provides internationalization of messages and labels using MessageResources. I have a requirement that all the error messages (not the fields labels on the form) should come from a table in the database. I know how to do this using a messageresource properties file. Is there any way I can retrieve the error messages from a database table and still be able to provide internationalization. Please help.

    have look at this page:
    http://java.sun.com/docs/books/tutorial/i18n/resbundle/propfile.html
    if they are using a code line like this
    ResourceBundle labels =
    ResourceBundle.getBundle("LabelsBundle", currentLocale);
    in struts you should be able to simply provide
    a class named like the application properties you specify in struts-config.xml implementing the ResourceBoundle interface ... and it should get called for retrievign messages.
    You should be able to find details on the page mentioned above.
    Also it might be a good idea to browse the struts sourcecode for a line like the one above to check if they really do it that way..
    good luck
    Spieler

  • Struts question - message-resources

    Hi,
    I'm trying to do someting which should be pretty straight forward, but can't figure it out. In my application.properties file I have a setting. (DEBUG = true). I can spit this value out in my jsp easy enough using
    <bean:message key="DEBUG"/>
    But what I want to do is be able to decide in the jsp (using some logic) if the flag is set to true, then show some hyperlinks (for debugging purposes).
    What I kinda want to do is this (i know this doesnt work)....
    <logic:equal name="message?" property="DEBUG" value="true">
    <p>debug mode</p>
         .. print some stuff
    </logic:equal>
    Obviously I'm not getting a handle to a bean here & thats why it doesnt work. But is there a simple way to do this. I dont want to code this property into into a bean - there must be some way of doing it.
    I was looking around on the web and found a site where somebody mentioned that a "messages" bean is created and put in the session. If this is true then I could possibly get the above syntax to work, but I dont know how to get the name of the bean - (message doesnt work)
    Any help would be greatly appeciated
    Paul

    I don't think the logic tags are tied into struts like the bean and html tags. The only way I know of is to get the message resources the hard way...
    <%
    MessageResources mr = (MessageResources)application.getAttribute(Globals.MESSAGES_KEY);
    Locale locale = (Locale)session.getAttribute(Globals.LOCALE_KEY);
    pageContext.setAttribute("DEBUG", mr.getMessage(locale, "DEBUG"));
    %>
    <logic:equals name="DEBUG" value="true">
    That should work, I think.

  • Sorry for a struts question

    Currently I have a list of objects in a hashtable
    In the JSp I itereate over them using struts taglib and display the appropriate content. The problem is with checkboxes that I need to display. I am unable to get the right value for the checkboxes even if everything is indexed during the iteration. I donot know how to rest a checkbox field in the ActionForms reset() method which resides in a hashtable holding a list of objects
    e.g
    myHashtable[3]
    |------------> ob[0] -> chcekbox field
    |------------> ob[1] -> chcekbox field
    |------------> ob[2] -> chcekbox field
    a similar structure

    1.jsp
    <logic:iterate name="MyForm" id="hashtable"
                   property="hashCollection">
    <td>
    <html:checkbox name="hashtable" property="myCheckBox" indexed="true" value="true"/>                                   
    </td>
    </logic:iterate>
    2. ActionForm(MyForm)
    private Hashtable hashtable;
    public Object getHashtable(int index)
    return this.hashtable.values().toArray()[index];
    public Collection getHashCollection()
    return hashtable.values();
    hashtable is a collection of objects of which myCheckBox is an element
    Now even if I select the checkbox on Jsp , it never really sets the actual value in the object. Any possible solutions or workarounds?

  • Workshop controller and struts question

    I have an application we converted from a nonworkshop to a workshop application. Both Struts and the Workshop controller is being used. When I go into the logic the uses the Workshop's controller then try and click another tab or link that uses struts, it does not render the page on the first click. The second click it then forwards appropriately. There are no stack traces to indicate any problems. It appears to be some setting or bug issue. Any help would be very appreciative.

    Thanks, though I am not using an application server.
    I am just looking to use the Struts framework with Studio One IDE and Tomcat. Is there anything special I should know? Does Studio One need special configuration?
    Thanks.
    Marc

  • Struts - question about attribute help

    In an Action class,
    I have actionMapping.setAttribute("xxx") and then I use actionMapping to forward it to another jsp. How can I use EL to get the value of xxx?
    Thank you!!

    Something like
    <c:out value='${xxx}' />
    If you are using jsp 2.0 and just want to display the value, you could just use ${xxx}
    The value of the attribute blah blah is ${xxx}cheers,
    ram.

  • Need to understand Struts Framework

    Greetings everyone,
    I am trying to understand how the entire Struts Framework works.
    If I am running tomcat, is copying and pasting the WAR file into webapps directory the only way to install struts?
    Since I am new to struts and was trying to understand how it works from ground up, I tried creating the neccessary files needed and copied the struts.jar into my web app's WEB-INF\lib folder.
    Unfortunately, I kept on hitting errors.
    Here is my app directory structure
    1) MyApp/
    - index.jsp
    - displayname.jsp
    2) WEB-INF/
    - struts-config.xml
    - struts-html.tld
    - web.xml
    3) WEB-INF/classes/example/
    - NameAction.class
    - NameForm.class
    4) WEB-INF/lib/
    - servlet-api.jar
    - struts.jar
    I am getting this error:
    HTTP Status 404 - /StrutsActionForm/index.jsp
    type Status report
    message /StrutsActionForm/index.jsp
    description The requested resource (/StrutsActionForm/index.jsp) is not available.
    Apache Tomcat/5.5.20
    I know it sounds silly but that's the only way I can truly understand the entire struts framework.
    Your reply will be much appreciated.

    If you specify the appBase of your application in Tomcat's server.xml ,
    or define a <Context>.xml and point the docBase to where ever your code's main directory is, you won't hae to create a WAR file and place it under WEB-INF each time you make any change.
    This saves a lot of time and effort in the development envionment, especially when you make a change to JSP pages - you can just refresh the browser to see the changes instead of creating a WAR file just to see changes in JSPs.
    Create a WAR file only when you are deploying your application to production / live website - a WAR file is not necessary in dev environment.
    With the above set-up your project can be located outside and independent of Tomcat, as long as the appBase or docBase are pointing to the location of your project.
    For tomcat related questions join the Tomcat User Mailing List
    and for struts question Struts User Mailing List

  • What has '.do' to do with Struts???

    Hey, a basic struts question. Well, in the web.xml *.do url patterns are mapped to the ActionServlet. In my form, I have action="/registration" (using the html:form tag..). The request goes to ActionServlet as the uri is /registration.do How & Where & who is appending the .do to my request?

    Is it possible to have few .do and a few .something mappings in my struts-config.xml
    say in form1 I want to have action="/action1.do" and form2 I want to have "/action1.action" with the two mappings defined properly in the struts-config.xml. Is this totally weird? want to know if this is possible and if not why?
    Thanks..

  • Struts ActionForm bean retuning null values

    Hello friends,
    I am new to struts framework, I am trying a simple application which gets form details from user store it in ActionForm and showing in a jsp. Now the problem is when i try to get the bean values form the Action form it is returning only null values. but the values i entered in <html:form> is getting stored in the ActionForm.
    I am very much confused with this problem.Your help is greatly appreciated
    regards,
    Muthu

    r035198x wrote:
    I'm not too sure about this but I think struts questions are not all that welcome in this forum.
    Better try the dedicated struts forum at Apache.They're not per definition forbidden here, but it's just merely that you will have more chance to meet real Apache Struts experts at a Apache Struts forum instead of a general Sun Servlet forum, let alone Sun JSP/JSTL or Sun JSF forum.

  • How To add dynamic field using struts?

    Hi All,
    I new to the struts. I wanted to add dynamic form field .

    Why do so many people ask struts questions here? It's an Apache project and it has a mailing list. Why not go directly to the source? [http://struts.apache.org/]
    Kaj

  • Struts optionsCollection issue

    Hi,
    I have a jsp page that contains a combo box that i wud like to populate with values coming from a DAO - DocumentDAO. However I get an empty drop down. Following are the relevant code snippets. I have been trying to solve this since long .. any help is welcome.
    <html:select name="DocumentForm" property="tmpdocumentType">
    <html:optionsCollection name="DocumentForm" property="typeOfDocumentsList" label="documentTypeId" value="documentTypeDesc"/>
    </html:select>
    In my Action :
    public ActionForward execute(ActionMapping mapping,
                   ActionForm form,
                   HttpServletRequest request,
                   HttpServletResponse response) {
    System.out.println("here ))))))");
    try {
    DocumentForm docForm = (DocumentForm) form;
    DocumentDAO dao = new DocumentDAO();
    //doctypes holds objects of type DocumentTypeTO
    ArrayList typeOfDocumentsList = dao.getDocumentTypesTOList();
    docForm.setTypeOfDocumentsList(typeOfDocumentsList);
    request.setAttribute("typeOfDocumentsList", typeOfDocumentsList);
    In my FORM class :
    private List typeOfDocumentsList= new ArrayList();
    public void setTypeOfDocumentsList(List typeOfDocuments){
         this.typeOfDocumentsList = typeOfDocuments;
    public List getTypeOfDocumentsList(){
         return typeOfDocumentsList;
    TO Object :
    public class DocumentTypeTO implements Serializable{
         public DocumentTypeTO(int id, String desc){
              documentTypeId = id;
              documentTypeDesc = desc;
         public DocumentTypeTO(){
         private int documentTypeId;
         private String documentTypeDesc;
         public void setDocumentTypeId(int documentId){
              this.documentTypeId = documentId;
         public int getDocumentTypeId(){
              return documentTypeId;
         public void setDocumentTypeDesc( String documentTypeDesc ){
              this.documentTypeDesc = documentTypeDesc;
         public String getDocumentTypeDesc(){
              return documentTypeDesc;
    Where am I going wrong ?

    Please post Struts questions on a Struts forum or in the JSP forum [ http://forum.java.sun.com/forum.jspa?forumID=45 ]

  • Struts ? - (Urgent)

    The code in Action
    boolean war= false;
            if ( CD.after(AD) ){
              war= true;
              msgAgreement="val";
            req.setAttribute("war",""+war);Code in Struts Config file
    <action path="/tell/Act"
                type="com.user.action.SampleUser"
                name="uform" scope="session" validate="false">
          <forward name="success"           path="/tell/scent.do" />
          <forward name="failure"             path="/tell/leave.jsp" />
          <forward name="error"             path="/tell/login.jsp" />
          <forward name="val"             path="/tell/login.jsp" />
      </action>code in JSP
    <c:when test="${war == 'true'}">
                   alert("This is the Warning ");
              </c:when>Here this code is working fine but afterthe alert message is been displayed i want to go to the "scent.do" page am not able to do it can anyone please help me in this?

    Asking a Struts question in a forum about Java programming wasn't a good choice either. But I've noticed that people who have urgent problems seem to panic and strike out in random directions. I expect taking a couple of minutes to search out a Struts forum would have been a good investment of time, but urgency overrides all.

  • A Struts doubt

    Hi All,
    pardon me for posting a Struts question.
    I have an ActionForm which i have populated from my Action class.
    Then that Action class forwards to a particular JSP where i retrieve the
    form which is kept in request scope and would like to Display the values
    of the form.I had everything working when the scope was session.
    But acc. to my knowledge the form object should be in the request scope
    and the contents would be displayed into the forwarded JSP.
    Please help

    thanks All.... my query is resolved.

Maybe you are looking for

  • Keeping Contacts & Apps when syncing iPhone with new computer

    I just got a new netbook with Windows 7 Starter. I would like to transition from using my current work laptop to the netbook as the manager of my iPhone. When I try to sync my iPhone with the new computer it says that my iPhone's library is linked to

  • Can no longer access airport base station

    I can surf the net via airport, but wireless printing has stopped working. I can also no longer configure the base station via the admin utility - just get an error message "an error occured whilst reading the configuration". any suggestions what i c

  • 8i and the Palm KVM

    Are there plans to release an Oracle JDBC driver for the KVM?? Is there any way to access an Oracle Lite database on the Palm with Java?

  • Servicelayer.exe crashes when backing up

    Hi there guys, I am currently having a problem with PC Suite where the servicelayer.exe crashes when doing a phone backup. OS: Windows Vista PC Suite: 6.82.22.0 Phone: N80 Whenever I try to do a phone backup it gets to 50% the servicelayer.exe crashe

  • Problem in Delivery Creation

    Hi All, I have a requirement to create a delivery from sale order. Iam using BAPI_DELIVERYPROCESSING_EXEC bapi to create sale order. I have passed the data as below. The below code is creating delivery in my ECC 6.0(Sand Box) but my client system is