Multiple buttons in jsp page

Hi to all
afteradminlogin.jsp:--
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
      <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<!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>Insert title here</title>
</head>
<body>
<h4>Select your Department</h4>
<br>
<html:link forward="adminbooks">Java</html:link>
<br>
<br>
<html:link forward="adminbooks">.Net</html:link>
</body>
</html>in this page when we click on java link it has to move to the adminbooks .but it is not moving it is showing empty page in that place
adminbooks.jsp:--
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
      <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<!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>Insert title here</title>
</head>
<body>
<input type="hidden" name="method">
<h4>Welcome To Selection</h4>
<table border="1">
<tr>
<th>
sno
</th>
<th>
Book Name
</th>
<th>
Author
</th>
<th>
Available No.of Books
</th>
<th>
Select
</th>
</tr>
</table>
<html:submit name="add" value="add" >Add</html:submit>
<html:submit name="edit" value="edit">Edit</html:submit>
</body>
</html>in this above jsp page i am using two buttons .in this page when we click on add button it has to go to another page and after submit that page that data has to add the the above table how can done that one
where add button jsp page
adminaddbooks.jsp:--
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    %@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<!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>Insert title here</title>
</head>
<body>
<br>
Book Name <input type="text" name="bookname">
<br>
<br>
Author <input type="text"  name="author">
<br>
<br>
Available No.of Books <input type="text" name="availablebooks">
<br>
<br>
<input type="submit"  value="submit" name="submit">
</body>
</html>strutsconfig.xml:--
<struts-config>
    <form-beans>
    <form-bean
           name="AdminForm"
           type="org.struts.library.admin.AdminForm">
</form-beans>
<global-forwards>
<forward   
                 name="userlogin"
                 path="/Logon.do"/>
        <forward
                 name="adminlogin"
                 path="/adminlogin.do"/>   
       <forward name="adminbooks"
                path="/adminbooks.do"/>         
        <forward
            name="home"
            path="/home.do"/>
    </global-forwards>
<action-mappings>
<action
         path="/adminlogin"
         forward="/pages/adminlogin.jsp"/>
         <action
              path="/adminaction"
              type="org.struts.library.admin.AdminAction"
              name="AdminForm"
              scope="request"
              validate="true"
              input="/pages/adminlogin.jsp">
         <forward   name="success"
                    path="/pages/afteradminlogin.jsp"/>
         <forward    name="failure"
                     path="/pages/adminlogin.jsp"/>
                     </action>        
              <action path="/adminbooks"
                     type="org.struts.library.admin.AdminBooksAction"
                    forward="/pages/adminbooks.jsp">
              <forward name="add"
                      path="/pages/adminaddbooks.jsp"/>
              <forward name="edit"
                       path="/pages/admineditbooks"/>
                     </action>                           
              </struts-config>

if you link to an action doesnt work then maybe your action is wrong but you didnt post it.
You cannot submit a form if you dont use a form in your code
Other general advice:
Study Struts better and make sure you know HTML/JSP
Get an example running and then start with a simple "Hello Struts" test with an Action that doesnt do much

Similar Messages

  • I have a button in JSP page inside an UIWebView by pressing the button i want to run another existing iPhone native application in background only.Do anyone have a solution for this.

    I have a button in JSP page inside an UIWebView by pressing the button i want to run another
    existing iPhone native application in background only.Do anyone have a solution for this.

    Sounds like a virus.... I hope it's not...
    Launching Other Apps within an iPhone

  • How to get multiple selections from jsp page in my servlet

    Hello Everyone,
    I've a list that allows users to make multiple selections.
    <select name=location multiple="multiple">
        <option>
             All
        </option>
        <option>
             Hyd
        </option>
        <option>
             Dub
        </option>
        <option>
             Mtv
        </option>
      </select>I want to get the selections made by user in jsp page from my servlet, selections can be multiple too.
    ArrayList locList = new ArrayList();
    locList = request.getParameter("location");when I do so, I get compilation error as the request returns string type. How do I then get multiple selections made by the user.
    Please let me know.

    For those kind of basic questions it would help a lot if you just gently consult the javadocs and tutorials.
    HttpServletRequest API: [http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html]
    Java EE tutorial part II: [http://java.sun.com/javaee/5/docs/tutorial/doc/]
    Coreservlet tutorials: [http://courses.coreservlets.com/Course-Materials/]

  • Print Button on JSP page prints title,time etc

    Hi I have aprint Button on my jsp page which prints whatever I want selectively using the <style tags>
    <style type="text/css" media=print>
    .noprint { display: none}
    .noscreen { color: black }
    </style>
    <style type="text/css" media=screen>
    .noscreen { display: none}
    .noprint { color: blue }
    </style>
    <SCRIPT Language="Javascript">
    function printit(){
    window.print();
    </SCRIPT>
    My print Button calls the JavaScript and prints everything that does not have a class=noprint in it... When I print however it also prints on the page
    -The Title on the Left Top corner
    - Page 1 of 1 on RIGHT TOP
    - 2/13/03 on Left bottom
    - 4:06 thats the time on the RIGHT BOTTOM
    Is there anyway I can prevent it from printing this?

    These probably come from the browser. Check if your browser is configured to print these on every page that is printed. If so, you can turn these of from the browser's Page Setup dialog.

  • Insert from button in jsp page

    hi, im new o jso and needto make an insert frim a jsp page with a button,
    what should i do?
    i made a javascript function but i really dont know if am i right and then i tried to call this function from the html tag
    beside this i execute de query from java and it was success!!, but i dont know what is wrong when i try from the jsp page with de button, please help!
    thx!
    here it's my code:
    <script type="text/javascript">
    import java.sql.*;
    function Agregar()
    return
    StringBuffer sb = new StringBuffer();
    try{
    Class.forName("org.postgresql.Driver");
    Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/Prueba","postgres","hola");
    Statement stmt = conn.createStatement();
    stmt.executeUpdate("INSERT INTO tbl_responsable (cedula,nombre,direccion) VALUES (14021752,'carlos','caracas')");
    }catch(Exception e){
    System.out.println("EXPLOTO");
    </script>
    ahora en el html que debo hacer??, o si tengo q hacer otra cosa???
    html del boton:
    <input type="submit" value="Agregar" action="Agregar()">
    what should i do, what its wrong??
    thx again!

    try this
    <input type="submit" onclick=" return Agregar();">
    or
    <input type="submit" onclick=" Agregar();">

  • To search a record from the table by providing a search button in JSP page

    Hi,
    My problem statement is:
    I have a jsp page which displays a table containing records. I have to provide a button called search and a condition in a textfield so that the record which matches the condition gets highlighted.
    Can anyone solve my problem statement. Its urgent.
    Suraj.

    Example:
    on the jsp page, read the matched value the server provides and use it to put the statement in bold using the <b> tag (I dont know the syntax for highlighting).
    <%String matchedString=(String) request.getAttribute("matchingString");%>
    Then in your list:
    <%if(matchedString.compareTo(thisRecordString)==0){%>
    <b>
    <%}%>
    //your text goes here
    <%if(matchedString.compareTo(thisRecordString)==0){%>
    </b>
    <%}%>

  • How to save data in html format while user click a save button in jsp page

    Hi All,
    I have the following requirement
    If user click on the Save Button it should display a window which allows the user to select the directory and the data is stored in the Internet Explorer Format.
    Could please anybody suggest me how to impletment the above requirment in jsp page.
    It's very urgent. Please replay ASAP.
    Thanks
    Rajeshwari

    Analyzing ur ques ...
    If user click on the Save Button it should display a window which allows the user to select the directory and the data is stored in the Internet Explorer Format.hmmm..
    There is no html object type which supports directory selection for download. There is only an input type="file" which however is related to an upload scenario.
    By downloading the file using output stream u can achieve what you want.
    You simply need to do the following things ..
    a) Write to an output stream
    b) Set the content type to "text/html" for your response
    Example ....
    response.setContentType("text/html");
    response.setHeader("Content-disposition",
    "attachment; filename" +
    "Example.html" );
    javax.servlet.ServletOutputStream stream = res.getOutputStream();
    StringBuffer text = new StringBuffer(1024);
    text.append("some text . . . ");
    text.append("more text . . . ");
    stream.write(data);
    stream.close();

  • Multiple buttons in JSP

    hi,
    I am using a form in a JSP page with a back-end Oracle database. The JSP page displays a row of data from a table in the database, and i have an update button next to each one of them.
    The following code is used to create the buttons:
    <INPUT type="submit" name="u<%= i %>" value="Update">
    where i is the id of the row.
    I use the following code on the next page to know which button was pressed
    if (request.getParameter("u"+i) != null){
    All I want to know if how to replace the buttons on the first page with an image source without loosing the name/value property.
    thanks

    hi,
    i found a soln of the web.
    on the form page
    <input type="image" name="image" src="image.gif" alt="image" value="image">
    on the forwarded page:
    if (request.getParameter("image.x")!=null) {
    // image button pressed
    It works as i want to, but can someone explain why I need this '.x', and why it wont work simply with request.getParameter("image")
    thank you

  • Tab Button in JSP page using Jdeveloper

    Hi Guys
    I have a basic question, In Jdeveloper I am creating a JSP page. I need to have Tab buttons in that page, but i am not able to locate the tab buttons, I wanted to know that do Jdeveloper provides the facility for tab buttons, if it does, where can i find the tab button on the Jdeveloper.
    regards

    Yes, it is possible. But you must use ADF Faces technology. There is component called ShowOneTab.
    e.g.:
              <af:showOneTab position="above">
                <af:showDetailItem text="showDetailItem 1">
                  <af:inputText label="Label 1"/>
                </af:showDetailItem>
                <af:showDetailItem text="showDetailItem 2">
                  <af:inputText label="Label 1"/>
                </af:showDetailItem>
              </af:showOneTab>regards,
    Branislav

  • Browse for folder button in JSP Page

    Trying to create a browse for folder button in a JSP page. Anybody with some ideas on how to do this? Applet, Bean, some other way? Has anybody done this before? Is it even possible?
    Thanks in advance!

    We have done it with Struts before. Also seen it done with javascript.

  • How to get the values retained on clicking the back button in jsp page

    Hi All,
    I had two jsp's search and results. In the search page when i enter some values in the text fields, the rsults will be displayed for that search criteria. I had a back button in the results page. When i click on this back button i will get back to my search page. I am using the following code for this back button.
    <INPUT TYPE="button" VALUE='Back' onClick="javascript:history.go(-1)" class="button">
    Now the problem is when i get back to search page using this back button, i am not able to get the values in the search page which i entered, i am getting all blank values. What should i change to get these values back in the search page. Should i maintain any sessions for this?

    You have no control at all over the back button process. To the server, it's indistinguishable from the user simply tying the URL of your search page. So, you need to store this data server side*.
    When your search page is submitted and processed, store the values you received for each of the fields into the user's session. Then, when the search page is generated, check the session for these values, and for any values that are not null, put their values into the html as the default values for the textboxes and controls you are using. This lets you handle the whole matter on the server's side.
    *barring convoluted, unportable, black-magic javascript trickery which you should definitely avoid                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Back Button on JSP page

    Dear All;
    I am new to JSF. I have built a small sample application on JSF that is integrated with jetspeed which takes user name and password. If password is true it goes to successPage else goes to errorPage. This functionality is working fine.
    I want to have a back button in errorPage which redirects me to indexPage. I am using following line in my errorPage for back button.
    <h:commandButton id="submitButton" value="submit" action=""/>
    In faces-config.xml i am using following navigation rule:
    <navigation-rule>
    <from-view-id>/pages/ErrorPage.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/pages/index.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    First of all Back button is not showing and giving error as sampleApp::applicationPortlet is not available.
    Please suggest what might be the problem.
    Thanks in advance;
    Vikash Anand.

    No, an empty method is not needed. Just put the string in the action.
    <h:commandButton action="blah" />behaves the same as<h:commandButton action="#{myBean.action}" />where the empty action() method only returns a String = "blah".

  • Reporting on buttons in the LMS, when there are multiple buttons on the page

    I have a project, it is 2 slides in multiple languages adding up to 38 slides. The first slide appears in English . The user can click the language of their choice or  click I agree (reported action to the LMS for completion). If they click I agree, no problem.  They score 10 points and the requirement for completion is to score 5. 
    If the user clicks their language, they have the option to click I agree (reported action to the LMS) or they can go Back to English (Jump to first slide).  When I add the  reporting on the I Agree in the language slides.  The Back to English button will only advance to next slide even though it isn't set up that way.  The functionality works fine if I'm not trying to set up reporting.  Any suggestions?

    Hello and welcome to the forum,
    Not sure if I understand well, but think you are bumping into the Quiz scope... I have been trying to explain this in a blog post, with other functionalities of Question and Score slide:
    Question Question Slides
    Lilybiri

  • Handling multiple buttons in jsp

    hi guyz,
    I have a requirment where i need to handle different buttons in a single jsp form, where each button has different actions. For example, submit button , cancel button, reset button. It would b really helpful for me if any of u guyz can poste me the code . I know java script method but it wont meet my requirement.
    I appreciate any suggestions or help from ur side. Thanks in advance,
    B.S

    by the word 'different actions' u meaned the value of action attibute in ur form tag, then i guess u will hv to use java scripts..
    but if u want those buttons to perform diff actions
    then for submit button u cd say < type="submit" value="submit" name="btn"submit" > it will submit the current pg to the one specified in the action attribue. similarly for reset u cd say type="reset"...
    and for cancel button, if u wish to go back, then < type=button value=cancel onclick="history.back();" >

  • Need help in writing a .jsp page

    Hi Guys,
    I am new to JSP. My requirement is " I have a link on my webpage. When the user clicks that link, a HTML page is displayed which has parameters to be entered (for ex: from_date , to_date). When the user clicks the submit button, a jsp page should be displayed in which a query is run to display the output. For example, the user enters the from_date and to_date parameter values to know the employees employed within those dates in their company. The query is "select empname,empno,sal,dept,comm from emp where employed_date between from_date and to_date" . The following should run and display in the jsp page.
    How can i write a .jsp to extract the parameters that are entered in the HTML form in to a .jsp and run the query with those parameters to display the output. Help needed in making me write this .jsp for this query.
    Help Aprreciated.
    Thanks

    Hm, your requirements sound like homework assignment from classroom. If so, is itn't better that you find the answer youself? There are plenty of very relevant references for how to use jsp to handle html forms or talk to a rdbms through a jdbc connection. For example, for jsp and html forms, you can google "jsp html forms"; for jsp and sql query, search for "jsp jdbc".
    Tell me if this is not helpful.

Maybe you are looking for

  • Error after applying the patch p12748351

    Hi experts, We installed the OIM version 11.1.1.1.5.0, and we implemented a solution almost out of the box. After the patching to the version 11.1.1.5.1 we faced an issue during the target reconciliation from AD for the new users. We see that no new

  • How to control the measure based on the related dimension.

    Hi Experts, In order to improve performance, I have created three kinds of time tables in DB,such as Year .Month, Day. Then import them into the physical layer in RPD, and combine them into one dimension in BMM. Actually, it has three level fact rela

  • Changing character encoding in ps xml pub. from utf-8 to iso-8859-1

    I am using xml publisher to generate a report in a pdf format, now my problem is user has entered a comment which is not supported by utf but in iso-8559-1 its working fine, I tried to change the encoding in people code, xml doc file ,schema and xlif

  • T450S scrolling reverts to 1 line item at a time

    I have a Logitech M310 wireless mouse connected to my T450s via a USB dongle.My T450s has a touch screen and is running windows 8.1. I switch back and forth from using the red trackpoint and the external mouse. Almost every time the scrolling switche

  • RESTORE CONTACTS, CALENDAR, AND NOTES TO IPHONE 4S

    I recently had noticed that all my Contacts, Notes, and Calendar entries are gone. How can I get these items back onto my phone. I can see them when I log in to ICloud and can see the Contacts and Calendar, but do not see the stored Notes that I mhad