Having 2 forms in 1 jsp in struts

Dear All,
I m using struts 1.2.9 framework
in 1 of my JSPs i need to use 2 froms so actions are seperate
shall i use seperate action form beans and seperate action classes for each action?
I know this is very newbee question
kindly revert back
thanks in advance

You can have two seperate forms on a page, but the data in each has to completely independant.
ie
<form>
  <contents of form 1>
</form>
<form>
  <contents of form 2>
</form>If you want the same data, same input fields but two seperate "submit" buttons, I would implement it with the same actionform (its the same data) but use a dispatchAction (or similar) to execute a different operation depending on which button was pushed. I am guessing this is the scenario you have.

Similar Messages

  • Display of dynamic data in Listbox in jsp usin Struts

    Hi,
    I am trying to display a List in a jsp in Struts.
    I have written a Action form and am populating a Arraylist in a DAO(java class file).
    ArrayList.add(rs.getString(1),rs.getSTring(2));
    But I do not know how to display the arraylist in JSP using the struts tag libraries.
    Please let me know how this can be done.
    Thanks in advance.
    Sri

    Use logic:iterate or nested:iterate.
    You can refer to:
    http://forum.java.sun.com/thread.jspa?threadID=5164152&messageID=9629275#9629275
    http://struts.apache.org/1.x/struts-taglib/tlddoc/index.html
    SirG

  • Need help in jsp and struts projects

    hi
    i am using jsp and struts framework.
    in that i am putting values in session in one jsp and getting
    values in other jsp.i am having doud with how many values i will put in sessions and it will give any difficulty while running in servers.and i want to know any other equivalent way is there for sessions.

    hi
    i am using jsp and struts framework.
    in that i am putting values in session in one jsp
    jsp and getting
    values in other jsp.i am having doud with how many
    ny values i will put in sessions and it will give any
    difficulty while running in servers.and i want to
    know any other equivalent way is there for sessions.do u want all those vales at the same time? if not then u might use session.removeAttribute() method for trashing out the not needed objects.
    there are many ways of session handling.... passing as request param, also using hidden fields, else th URL rewritting...
    but all these are not efficient to be passed along if too many pages are using the same session objects. i believe u can also try passing it into an XML file and parse it out whenever needed. but i dont think thats feasible enough.
    hope it helps.

  • How to assign bean value to a local variable in JSP using struts.

    Hi everybody!
    I've a problem that puzzled me on how to assign a bean value to a local variable like String in JSP using struts.
    we can have someting like this to display the value
    <bean:write name="detailService" property="status" />or
    <bean:define id="theStatus" name="detailService" property="status"/>
         This is country: <%=theStatus%>but an error occured when I tried like this:
    String currentStatus = "<bean:define id="theStatus" name="detailService" property="status"/>";
    or
    String currentStatus = "<bean:write name="detailService" property="status" />";Is there a way to do this?.....
    Any help pretty much appreciated

    Java != JSP.
    The <bean:define> and <bean:write> tags are custom tags meant to appear in the HTML section of a JSP file, as opposed to the scriptlet section. They actually get turned into java code as part of the translation process.
    The <bean:write> tag naturally just writes out what you tell it to.
    The <bean:define> tag defines a local variable, and gives it a value.
    this should do it.
    <bean:define id="theStatus" name="detailService" property="status" type="java.lang.String"/>
    <%
      String currentStatus = theStatus;
    %>With the advent of JSTL, you shouldn't really need to use scriptlet code anymore. Personally I am for 0% scriptlet code in any jsp I write.

  • Accessing values of components in a form in a JSP function

    Hi,
    I have a peculiar problem. I want to access the value of a textbox in my JSP method. Please let me know how to do that.
    The code is
    <%!     
         public boolean checkFile(String filepath)
         System.out.println("************ " + filepath);
         File f = new File(filepath);
         return (f.exists());
    %>
    the variable filepath should be the value taken from a text field.
    When the user enters a file name i need to check if the file exists or not. Is there a better way to do this. Please suggets me a way to solve this.. Very urgent.
    Thanks
    pops

    Well JSP is server side code and TextBoxes are html which is client side script. To get the value of an html Textbox you either can use Javascript and do it all client side or you can post your form to a JSP or servlet and use request.getParameter("field_name"); to get the value of the form field.
    make sense?
    -S-

  • [b]Data Grid in jsp using Struts [/b]

    I need to develop a data grid in JSP using struts .
    I am using Tomcat web server , Intellij IDEA IDE.
    If any one has code, please sent it.
    Thanks in Advance.

    hi,
    Use Struts-Layout datagrid framework to full fill your needs
    Related Topic link
    here is the clear documentation for your topic
    http://struts.application-servers.com/datagrid/index.html
    here is the download link
    (Struts-Layout datagrid framework)
    http://deltha.uh.cu/java/docs/struts-layout-1.0-docs/download.html
    related discuss
    http://forum.java.sun.com/thread.jspa?threadID=5202989&messageID=9811082

  • Is it possible to use two diff forms in same jsp/jsf page?

    Hi all,
    My requirement is to submit the form based on selection of radio button.
    since half part needs to be jsp based which is not using any tags etc.
    But i am trying to use some jsf based component which requires to be inside <f:view><h:form> of
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    i.e. some <c:comboBox>
    </h:form> </f:view>
    Now earlier i was submitting the form as
    <form action="/techstacks-v2_1/reportAction.do" method="post" name=doSearch id='doSearch'>
    But now i found, in order to use combo box component which is entirely jsf based i need to use <f:view><h:form> which is kind of taking over the previous form submission mechiansm.
    I am trying to keep them separate as two differnt forms.
    one entirely jsp based and other as jsf based.
    Now my question is can i use such way of doing so or is there any better way of implementing so.
    My friend suggested that i can pass the value of jsf based form in hidden form to a input box of form to be submitted finally instead of submitteing two diff forms.
    but in that case also i ahev to use two forms in a single jsp/jsf page.
    suggest me something which can really work out.
    thanks
    vijendra

    You can use as many forms as you want as long as you don't nest forms. The HTML spec probibits that.

  • How to make result of form post to jsp to appear in child frame

    Two frames inside a frameset, A and B (A is the first frame, B is the second). A has as it's source an html page containing a form with a submit button. The form posts to a jsp called Content.jsp. Works great, except: I want the results returned by Content.jsp to appear inside frame B. Seems like I've got the target for the form inside A wrong somehow, because when I click the submit button inside frame A, my results appear in a new browser instance, rather than inside B. Here's what the form declaration looks like:
    <form action="Content.jsp" method="post" target="_parent.frames[1]">
    If I make the target parent, that obviously replaces the whole page. If I make the target self, that obviously replaces the contents of frame A. I want to replace the contents of frame B. Any ideas?

    Thanks, but I'm not using IFrame, just Frame and FrameSet. In any event, I have tried using the name attribute to no avail. Here's a really simple version of the code:
    //Parent frameset
    <frameset rows="50%,50%">
    <frame name="A" src="testSubmit.html">
    <frame name="B" src="">
    </frameset>
    //Here's the form in testSubmit.html
    <form ACTION="testResult.html" METHOD="POST" TARGET="_parent.B">
    <input TYPE="SUBMIT" VALUE="Click Me">
    </form>
    I've also tried TARGET="_parent.frames[1]" with the same result -- a new browser window is launched rather than the results being displayed in B.
    Thanks for any assistance.

  • ADF Search form inside a jsp page's panel page container

    I am going through the Oracle JDeveloper 10g for Forms & PL/SQL book and I got to page 391 where I need to drop a search form onto a jsp page set up with a panelpage. The form show up but when I go to delete the extra fields JDeveloper completely locks up. I am running JDeveloper version 10.1.3.3.0.4157. I tried reinstalling it and it still locks up. I tried going back a few steps and recreate the search form and it still locks up.
    Can anyone explain why it is locking up or how to delete the extra fields without locking up?

    I also tried selecting a field in the source file code window. Just selecting a field in any form or window locks up JDeveloper. My program worked find until I created a search form from a data set. I think it is a bug in the version of JDeveloper I have. I did a similar task in a previous version and it worked fine. I could select and delete fields with no problem.

  • Displaying Hashmap values in JSP using struts taglib

    Please can any one provide me the solution for the below query,
    I have stored hasmap key as string and value as arraylist, can any one suggest how to display the hashmap values(arraylist) in table format in jsp using struts taglib.
                             HashMap hsMap=new HashMap();
                             ArrayList arrList = new ArrayList();
                             arrList.add("filesize");
                             arrList.add("filelength");
                              hsMap.put("filename",arrList);
               In jsp i want to display filename and filesize in table format.

    Read this documentation:
    http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-logic.html#iterate

  • Dynamic Textboxes in JSP using struts

    Hi all
    I'm using JSP and Struts framework. I have two buttons Add row and delete row.(not submit buttons) on click i need to either generate or delete a row of textboxes. I able to do the same using javascript but the tag in that case is <input..>(normal HTML) and not <html:text> tag of struts.. Can i use the struts tag in jsp?? I tried but err... So any suggestions?
    A sample code would be of great help.. Im still a beginner in this ocean of Java!
    cya

    If the add/delete row buttons run in javascript, then you have to use the standard <input> tags.
    The struts <html:text> tag is a JSP tag that just generates an <input> at the end of the day anyway (filling in the attributes automatically though)
    As long as you name the controls consistent with what would have been produced by the struts tag, it should work perfectly well.

  • How to pass one JSP form to next JSP ?

    i am using the two JSPs. i want to pass the form name of the first JSP to the second JSP and then assign the form name to second JSP form

    i have tone JSP file which is will be added to any JSP... This is my requirement.
    So i want to get the parent JSP form name and asign to the this JSP form name ... so that this code will be Generic

  • Oracle Form Vs OAF JSP Form

    I have some basic questions regarding Oracle Forms and OAF JSP forms. There is a requirement by the client to create custom forms for a functionality not available in Oracle Applications R12. I have to make the decision if Oracle forms or OAF JSP should be used to develop these forms. I have been told that both are supported in R12. I would like to know what is the advantage of doing one over the other? What factors do I need to consider?
    Thanks

    and the appeal is not only about good looking UI, but more on making better user experience, less coding effort, easy maintenance, low cost (on hardware/software), thin clients, and the reason for whole internet revolution based on browser based applications
    Tapash

  • Passing FORM parameters when opening form from a JSP

    Hi,
    is it possible to pass form parameters when opening the form from a JSP as a URL. If yes then what should be the way in which parameters has to be passed.
    thanks.

    Hi,
    Sorry there was some confusion.
    I want to pass parameters to a (D2K) form from a JSP. I'm able to open the D2K form but unable to pass the parameters into that form.
    Is it possible to pass parameters to D2k FORM from a JSP...
    Thanks

  • JDeveloper editing JSP with Struts tags terribly, terribly slow!?

    I use JDeveloper 10.1.2 and I do not know the reason but it started to take 15min just to change/edit JSP containing Struts tags. RAM memory is 1GB and there is more than 0.5 GB available, but processor usage shows 100% allocated to JDeveloper!? As soon as I do even slight change in a JSP file JDeveloper starts some computations and I have no idea of what it is doing.
    What is JDeveloper computing? It seems it tries to produce some drop-down lists "helping" me to do the editing, add tags and instead I am spending days to just change one small JSP page!
    How can I stop and PREVENT JDeveloper doing ANY "help" during editing of ANY file?
    There must be an option to switch off whatever JDeveloper is doing?
    Many thanks,

    I did that but it is still very slow, it looks like Jdev is doing some intensive calculations whenever I click somewhere on JSP page with tags. Maybe this is related with my other question I posted before this one? Maybe JDev automatically searches for tag libraries it cannot find and copies them to /WEB-INF directory? (other IDEs used in same environment, like Eclipse and IntelliJ, and they do not have this problem)
    Some other strange things: struts-config.xml seems not integrated with CVS from JDev (other files like tiles-config.xml, web.xml etc. are integrated, I can right click and get CVS info on particular file, except struts-config.xml). When I want to check in/out struts-config.xml I have to do it with external tool like WinCVS etc., cannot do that from JDev!

Maybe you are looking for

  • Can I get four inputs voltage reading from four sources at a time from NI USB 6009 DAQ

    I had a photoquadrant detector with four quadrants . each quadrant have a positive lead.  If i connect each lead to the DAQ's a0, a1, a2, a3 terminals and common ground to one of the ground of DAQ. Is it able to read four voltages from four quadrants

  • Java files work but jar files do not

    Hello everyone! My java files run normally and I get a response that I expect (which is successful). Imagine my surprise when I collected them in a Jar and the very same files inside the jar no longer work! I get a response (still generated by my jav

  • Date format in BEx

    dear all, i have a rather simple but puzzling question on my mind regarding date format in BEx reporting. here's the problem... in SU01 the date format for my users are MM/DD/YYYY. So for example, a variable in my BEx report, will only accept this va

  • Professional Photo Screen Displays

    Ex Professional photographer, from film era, back into digital photography. My 2-year-old MacBook screen's quality is dwarfed by current screen technology. Apple seems to either sell displays combined with CPUs or very expensive stand-alone screens f

  • Did 10.4.7 enable two finger right click?

    I already had the hack installed but not after the upgrade to 10.4.7 I don't have to toggle it off/on after reboot so it seems like the os update addressed this issue. Can anyone confirm this, just curious?