Help with forwarding within a JSP

Currently I am using the following to do a forward:
  RequestDispatcher rd = request.getRequestDispatcher("/login.jsp");
  rd.forward(request,response);However, I need the URL/URI to show up in the forward. So, let's say you visit http://www.whatever.com/whatever.jsp, and you do the RequestDispatcher in there to another JSP, it won't show that second file int he URL or URI.
Is there a way to get it to forward, with params, in a GET fashion (as in method=GET)?

I screwed up on the code blocks, sorry about that.
I was reading in my JSP book from Oreilly, about some ora:redirect which may do what I want, but I can't seem to get it to redirect/forward with those params still.
Anyone know what I can do to do what I posted in the first post?
Thanks...

Similar Messages

  • Need help with navigation within a spark list...

    hey guys, so in my application when you click on a list item, it opens up an image, and along with the image a few buttons are created dynamically...
    the image and the url/labels for the dynamic buttons is provided through an xml/xmlListCollection.
    what i need help with is the url or more specifically when you click on one of these dynamic buttons it needs to navigate me to another part of an list or display a certain set of images that is not in my spark list...
    please let me know if this makes no sence
    the code i have is
    <code>
        [Bindable] private var menuXml:XML;
        [Bindable] private var imgList:XMLListCollection = new XMLListCollection();
        [Bindable] private var navControl:XMLListCollection = new XMLListCollection();
        [Bindable] private var fullList:XMLListCollection = new XMLListCollection();
        private var returnedXml:XMLListCollection = new XMLListCollection();
        private var myXmlSource:XML = new XML();
        //[Bindable] private var xmlReturn:Object;
        private var currImage:int = 0;
        //public var userOpProv:XMLListCollection = new XMLListCollection();
        //private var troubleShootProvider:XMLListCollection = new XMLListCollection();
        private function myXml_resultHandeler(event:ResultEvent):void{
            userOptionProvider.source = event.result.apx32.userOptions.children();
            troubleShootProvider.source = event.result.apx32.troubleShooting.children();
            fullList.source = event.result.apx32.children();
            returnedXml.source = event.result[0].children();
            myXmlSource = event.result[0];
        private function myXml_faultHandler(event:FaultEvent):void{
            Alert.show("Error loading XML");
            Alert.show(event.fault.message);
        private function app_creationComplete(event:FlexEvent):void{
            userOptions.scroller.setStyle("horizontalScrollPolicy", ScrollPolicy.OFF);
            myXml.send();
            //trouble.scroller.setStyle("horizontalScrollPolicy", ScrollPolicy.OFF);
            myXml = new HTTPService();
            myXml.url = "modules/apx32/apx32TroubleshootingXml.xml";
            myXml.resultFormat = "e4x";
            myXml.addEventListener(ResultEvent.RESULT, myXml_resultHandeler);
            myXml.addEventListener(FaultEvent.FAULT, myXml_faultHandler);
            myXml.send();
        private function troubleShootChange(event:IndexChangeEvent):void{
            dynamicButtons.removeAllElements();
            navControl.source = troubleShootProvider[event.newIndex].children();
            currImage = 0;
            imgList.source = troubleShootProvider[event.newIndex].images.children();
            definition.source = imgList[currImage].@url;
            if(imgList[currImage].@details == "true"){
                if(imgList[currImage].buttons.@hasButtons == "true"){
                    for each(var item:XML in imgList[currImage].buttons.children()){
                        var newButton:LinkButton = new LinkButton();
                        newButton.label = item.@name;
                        newButton.x = item.@posX;
                        newButton.y = item.@posY;
                        newButton.setStyle("skin", null);
                        newButton.styleName = "dynamicButtonStyle";
                        dynamicButtons.addElement(newButton);
            //var isMultiPage:String = navControl[2]["multiPages"];
            //trace(isMultiPage);
            //        if(isMultiPage){
            if(currImage >= imgList.length - 1){
                next.visible = false;
                back.visible = false;
            else{
                back.visible = false;
                next.visible = true;
        private function customButtonPressed(event:Event):void{
            if(imgList[currImage].button.@changeTo != ""){
        private function userOptionsChange(event:IndexChangeEvent):void{
            dynamicButtons.removeAllElements();
            navControl.source = userOptionProvider[event.newIndex].children();
            currImage = 0;
            imgList.source = userOptionProvider[event.newIndex].images.children();
            definition.source = imgList[currImage].@url;
            if(imgList[currImage].@details == "true"){
                if(imgList[currImage].buttons.@hasButtons == "true"){
                    for each(var item:XML in imgList[currImage].buttons.children()){
                        var newButton:LinkButton = new LinkButton();
                        newButton.label = item.@name;
                        newButton.x = item.@posX;
                        newButton.y = item.@posY;
                        newButton.setStyle("skin", null);
                        newButton.styleName = "dynamicButtonStyle";
                        newButton.addEventListener(MouseEvent.MOUSE_DOWN, customButtonPressed);
                        dynamicButtons.addElement(newButton);
            var isMultiPage:String = navControl[2]["multiPages"];
            if(isMultiPage == "true"){
                if(navControl[2]["next"] == "NEXT STEP"){
                    navContainer.x = 630;
                else{
                    navContainer.x = 640;
                next.label = navControl[2]["next"];
                back.label = navControl[2]["back"];
            if(currImage >= imgList.length - 1){
                next.visible = false;
                back.visible = false;
            else{
                back.visible = false;
                next.visible = true;
        private function nextClickHandler(event:MouseEvent):void{
            currImage += 1;
            dynamicButtons.removeAllElements();
            if(currImage >= imgList.length-1){
                currImage = imgList.length - 1;
                //next.visible = false;
                next.label = "YOU'RE DONE";
            else
                next.label = navControl[2]["next"];
            back.visible = true;
            if(imgList[currImage].@details == "true"){
                if(imgList[currImage].buttons.@hasButtons == "true"){
                    for each(var item:XML in imgList[currImage].buttons.children()){
                        var newButton:LinkButton = new LinkButton();
                        newButton.label = item.@name;
                        newButton.x = item.@posX;
                        newButton.y = item.@posY;
                        newButton.setStyle("skin", null);
                        newButton.styleName = "dynamicButtonStyle";
                        dynamicButtons.addElement(newButton);
            definition.source = imgList[currImage].@url;
        private function backClickHandler(event:MouseEvent):void{
            currImage -= 1;
            dynamicButtons.removeAllElements();
            if(currImage == 0){
                back.visible = false;
            next.visible = true;
            next.label = navControl[2]["next"];
            if(imgList[currImage].@details == "true"){
                if(imgList[currImage].buttons.@hasButtons == "true"){
                    for each(var item:XML in imgList[currImage].buttons.children()){
                        var newButton:LinkButton = new LinkButton();
                        newButton.label = item.@name;
                        newButton.x = item.@posX;
                        newButton.y = item.@posY;
                        newButton.setStyle("skin", null);
                        newButton.styleName = "dynamicButtonStyle";
                        dynamicButtons.addElement(newButton);
            definition.source = imgList[currImage].@url;
    </code>
    i have attached a copy of the xml that i have right now to this post for reference...
    any help will be greatly appretiated!!! i've been stuck on this problem for the last week and my project is due soon
    again thank you in advance...

    hey david... just nevermind my previous post... I was able to subclass a link button, so i now have two variables that get assigned to a link button,
    one is "tabId" <-- contains the information on which tab to swtich to, and the second is, "changeTo"... this contans the label name which it needs to switch to
    I'm just stuck on how to change my selected item in my tabNavigator/list
    the code i have right now is
        private function customButtonPressed(event:Event):void{
            if(event.currentTarget.tabId == "troubleShooting"){
                for each(var item:Object in troubleShootProvider){
                    if(item.@label == event.currentTarget.changeTo){
        private function userOptionsChange(event:IndexChangeEvent):void{
            dynamicButtons.removeAllElements();
            navControl.source = userOptionProvider[event.newIndex].children();
            currImage = 0;
            imgList.source = userOptionProvider[event.newIndex].images.children();
            definition.source = imgList[currImage].@url;
            if(imgList[currImage].@details == "true"){
                if(imgList[currImage].buttons.@hasButtons == "true"){
                    for each(var item:XML in imgList[currImage].buttons.children()){
                        var newButton:customLinkButton = new customLinkButton();
                        newButton.label = item.@name;
                        newButton.tabId = item.@tab;
                        newButton.changeTo = item.@changeTo;
                        newButton.x = item.@posX;
                        newButton.y = item.@posY;
                        newButton.setStyle("skin", null);
                        newButton.styleName = "dynamicButtonStyle";
                        newButton.addEventListener(MouseEvent.MOUSE_DOWN, customButtonPressed);
                        dynamicButtons.addElement(newButton);
            var isMultiPage:String = navControl[2]["multiPages"];
            var videoPresent:String = navControl[1]["videoPresent"];
            if(videoPresent == "true"){
                if(isMultiPage != "true"){
                    navContainer.x = 825;
            if(isMultiPage == "true"){
                if(navControl[2]["next"] == "NEXT STEP"){
                    navContainer.x = 630;
                else{
                    navContainer.x = 640;
                next.label = navControl[2]["next"];
                back.label = navControl[2]["back"];
            if(currImage >= imgList.length - 1){
                next.visible = false;
                back.visible = false;
            else{
                back.visible = false;
                next.visible = true;
    as you know, my xml gets divided into two saperate xmllistcollections one is the userOptionProvider, and the troubleshootingProvider
    as is in the following xml
    <mx:TabNavigator id="tabNav" width="275" tabStyleName="tabStyle" fontWeight="bold" height="400" paddingTop="0"
                             tabWidth="137.5" creationPolicy="all" borderVisible="false">
                <mx:VBox label="USER OPTIONS" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                    <s:List id="userOptions" width="100%" height="100%" itemRenderer="modules.apx32.myComponents.listRenderer"
                            borderVisible="false" contentBackgroundColor="#e9e9e9"
                            change="userOptionsChange(event)">
                        <s:dataProvider>
                            <s:XMLListCollection id="userOptionProvider" />
                        </s:dataProvider>
                    </s:List>
                </mx:VBox>
                <mx:VBox label="TROUBLESHOOTING">
                    <s:List id="trouble" width="100%" height="100%" itemRenderer="modules.apx32.myComponents.listRenderer"
                            borderAlpha="0" borderVisible="false" contentBackgroundColor="#e9e9e9"
                            change="troubleShootChange(event)">
                        <s:dataProvider>
                            <s:XMLListCollection id="troubleShootProvider" />
                        </s:dataProvider>
                    </s:List>
                </mx:VBox>
            </mx:TabNavigator>
    Im having some trouble updating my list... basically change to the troubleshooting tab, and then select the one that i need...
    hopefully that makes sence...

  • Help with Jtext fields on JSP page?

    Hi All,
    How can I collect an integer on a JSP page from user input?
    I am looking to vallidate the user input also thought about vallidating using HTML then passing/casting the input to a Java variable for further manipulation on the page.
    I cannot use response.encodeUrl for this.
    Effectively what I would like to do is replicate what a JTextField with an action listener would do to retrieve user input in a desktop Java application.
    Any ideas and help would be welcome.
    regards
    Jim Ascroft

    Hi All ,
    I propbably didnt put my questions all that well.
    So I wil try to be more specific.
    1.How can I collect an integer on a JSP page from user input?
    I am looking to vallidate the user input. I thought about vallidating using HTML then passing/casting the input to a Java variable for further manipulation on the page.
    I cannot use response.encodeUrl for this.
    2.I understand that my Java helper classes are compiled into .class files and then used by the JSP page as required. Also the Java code within the <% %> Java tags is recognised and runs .
    So if the java between the <% %> tags can be compiled and used why can other Java components eg Swing or AWT not be used in the same way?
    Effectively what I would like to do is replicate what a JTextField with an action listener would do to retrieve user input in a desktop Java application.
    Any ideas and help would be welcome.
    regards
    Jim Ascroft

  • Help with buttons within buttons

    I am trying to get stop and play buttons for the background
    music of my site to work within an animated rollover state of a
    separate button. When I put the stop and play buttons into the
    rollover animation they effect the hit state of the button they are
    inside, how do I get around this? If you look at
    www.thepixelplaypen.com/site you will see the menu bar at the
    bottom. If you click on the references button (the 3d thought
    bubble) i have directed it to how I want the page to look and work
    when the music bar is 'rolled over'.

    I've look at the site but am not sure what you mean. 1st I
    don't know what the music bar is. Are you talking about the menu
    bar when it's blank and minimized? Because when I go over that it
    jumps from expanding to its full form to back to its minimized
    state over and over.
    I think what you need is something a little more involved
    than the over/out states buttons give you.
    I would say a two state movie clip with a variable that flags
    on and off for the menu. Have the "toggle" turn off when moved out
    from the menu, but not when over the music switch. For example, a 2
    second delay that tests for the toggle being off, and the music
    button turns it on on over...
    Hope that helps...

  • Help with Printing on a JSP dynamically

    Hi
    I am using a bean to list customer information like this on a JSP page
    The bean has different customer information and the products purchased
    I iterate thru the bean on the jsp and i need to print it in the following format
    Customer Price
    CUstomer1........................................................................................$20.00/month
    Cutomer238899................................................................................$59.00/month
    check....................................................................................................$45.00/Month
    Now the biggest problem i have is printing the dots so that the price and customer stay fixed...How do I figure out dynamically how many dots to display????
    Can someone help me out thanks
    ~K

    I agree with that other person in that you should just use a TABLE (without using dots). BUT, if you are really persistent, you can use the <pre> tag so that every character displayed will take the same space. Figuring out the number of dots then just becomes a problem of calculating the length of each customer and the price subtracted by the total length of the whole thing.
    Easy as pie. =)
    ~ Joe

  • Problem with forward method of jsp

    am having problem with the requestDispatcher.forward method in my jsp + wml , the forward method gets executed but the new page is not displayed in the wap browser,
    code snippet
    small.jsp
    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
    <%@ page language="java" %>
    <%@ page contentType="text/vnd.wap.wml; charset=UTF-8" %>
    <%@ page import="java.lang.*,java.io.*,java.util.*,java.util.Vector,java.util.Properties "%>
    <%
    System.out.println("in small");
    RequestDispatcher rd = request.getRequestDispatcher("small1.jsp");
    rd.forward(request,response);
    %>
    small1.jsp
    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
    <%@ page language="java" autoFlush="false"%>
    <%@ page contentType="text/vnd.wap.wml; charset=UTF-8" %>
    <%@ page import="java.net.*,java.lang.*,java.io.*,java.util.*,java.util.Vector,java.util .Properties"%>
    <%
    String sm = "small1";
    System.out.println("in small1");
    %>
    <wml>
    <card id="two">
    <p>
    <small><%=sm%></small>
    </p>
    </card>
    </wml>
    i get the following output in the log
    in small
    in small1
    but i dont get to see the small1.jsp' content , also the response.sendRedirect method works fine ,,
    pls give me the soln
    Thnk u in advance

    thank u very for the repl this is the message which i get in the nokia wap browser...
    cannot load small1.jsp(HTTP Error 500 Server Error)
    and i use IBM WebSphere as the web server....
    and i have found that using response.reset in the small2.jsp overcomes this problem but the card title and the anchor tag is not displayed !!!!
    what could be this problem?

  • Need help with division within a query

    Hello all~
    I am trying to divide these two columns to get a % of case numbers involving an accident. Im pretty sure you need to use decode to avoid the divide by 0 error but not sure how to implement this within my query. When i run this query below, it gives me the result of "1", which is not correct. Can someone help me please?
    Oracle Version 10g
    ACCIDENT is a datatype VARCHAR
    CASE_NUMBER is a datatype VARCHAR
    select to_char(count(ACCIDENT),'999,999,999') as "ACCIDENT",
    to_char(COUNT(CASE_NUMBER),'999,999,999')as "CASE NUMBER",
    round(ratio_to_report(count(accident))
    OVER()*100,2)as "%"
    from      "PURSUIT"
    WHERE ACCIDENT = 'Y'
    AND
    (:P1_BEG_DATE IS NULL AND :P1_END_DATE IS NULL
    OR
    pursuit_date BETWEEN to_date(:p1_beg_date,'MM/DD/YYYY') and to_date
    (:p1_end_date,'MM/DD/YYYY'))
    AND(:P1_TROOP=pursuit.officer_troop OR :p1_troop IS NULL) 
    AND(:P1_RADIO=pursuit.officer_radio OR :p1_radio IS NULL)
    group by case_numberThanks
    Deanna

    Are you sure that the ANDs and ORs in your WHERE clause will take precedence properly?
    Also, if you always select only cases where there has been an accident, what percentage would you like to display? Surely in this case the percentage of cases involving in accident in cases where there was an accident.. is 100%?
    as a simpler example
    SELECT
      accident,
      ROUND(RATIO_TO_REPORT(count(*)) OVER() * 100)
    FROM
      pursuit
    GROUP BY
      accidentHere's a trick to neaten up those IS NULLs:
    SELECT
      accident,
      ROUND(RATIO_TO_REPORT(count(*)) OVER() * 100)
    FROM
      pursuit
    WHERE
      pursuit_date >= COALESCE(:p1_beg_date, pursuit_date) AND
      pursuit_date <= COALESCE(:p1_end_date, pursuit_date) AND
      officer_troop LIKE :p1_troop AND
      offcier_radio LIKE :p1_radio
    GROUP BY
      accidentTo wildcard a date, simply pass NULL in; the coalesce will replace the null with the pursuit_date from the record (thus the >= and <= becomes true)
    To wildcard the troop or the radio, simply pass a '%' symbol as the value of the parameter. If the front end code is already set up to pass nulls, use the COALESCE trick above

  • Need help with select within select - daterange

    I use Crystal Reports v12.3.0.601 - I am a beginner.
    Problem:
    TABLE: ACCOUNTBILLFEE
    Columns are   
    FOLDERRSN
    STAMPDATE
    BILLNUMBER
    PAYMENTAMOUNT
    There are over 500,000 rows/ records...
    And I need to report the FOLDERRSN which has at least one {ACCOUNTBILLFEE.STAMPDATE} in DateTime
    (2014, 05, 01, 00, 00, 01) to DateTime (2014, 05, 31, 23, 59, 59)
    Out-put required is:
    FOLDERSN | STAMPDATE | BILLNUMBER   | PAYMENTAMOUNT
    Group by FOLDERRSN
    1010234               May01,2014                 1111                      25000
                                  May25, 2014                1112                       5000
                                  Jan 05, 2013                  998                          500
    1034567                May5, 2014                11325                       5000
    1033999                May15, 2014               6752                       15000
                                  Dec5 , 2011                1132                       25000
    Please help -
    The critical part for me, is to display  payments not within the date range in 'select expert' statement.
    Currenlty my report reflects only payments for FOLDERRSN, where {ACCOUNTBILLFEE.STAMPDATE} in DateTime
    (2014, 05, 01, 00, 00, 01) to DateTime (2014, 05, 31, 23, 59, 59) and not other payments outside the date range specified.
    Thank you for your time.

    Hi Abilash,
    This worked !!!
    My brother helped me with it here....ofcourse you have intiated the intial idea.
    It worked when i used the following SQL at 'Add Command'
    Select * from DATABASE_NAME.ACCOUNTBILLFEE A
    Where A.FOLDERSN = any ( select B.FOLDERSN from DATABASE_NAME.ACCOUNTBILLFEE B
    where B.STAMPDATE >= TO_DATE('20140501', 'YYYYMMDD')
    AND  B.STAMPDATE <= TO_DATE('20140531', 'YYYYMMDD'))
    Excellent support - Thank you so much for your immediate attention and response.
    I know, how hard it is to understand someones requirement and suggest solutions.
    You are the best and most helpful I have ever come across in my life.
    Thank you for your kind heart and extending help to me.
    Regs,
    Sridhar Lam

  • Need help with Telnet command in JSP

    Here is the code I have been working on but it will not display the buffer to the page..
    String [] cmd1 = {"cmd.exe","/c","telnet hqsun1.xx.xxxxx.com"};
              Process n;
              String T = "" ;
              n = Runtime.getRuntime().exec(cmd1);
              BufferedReader in1 =
              new BufferedReader(new InputStreamReader(
              n.getInputStream()));
              while((T=in1.readLine()) != null)
              out.println(T+"");
    Maybe someone has done this before? I am trying to acomplish a telnet net session to the screen with some exicuted commands, because this tool is going to be used to help determine system status when the help desk needs to check on something.
    Thanks

    I don't want to be discouraging, but I'm not quite sure you've thought the problem through. You say that you'd like to create a web page capable of providing various pieces of information to the help desk, and you suggest ping and the output of various canned telnet commands as examples.
    What is preventing the help desk from just executing those commands at the command prompt?
    I realize that the people working the help desk are (ahem) there for a reason, but it is really much faster for me to just simply type "ping www.mpalfrey.com" at the prompt, then it is for me to fire up the web browser and wait for a response that way. You will likewise find that it is a lot more convenient to perform diagnosis on remote machines directly from the command prompt.
    Uh, it's kind of like giving someone a screwdriver, then saying, "oh wait a second" and making them wear an oven mitt in order to use the screwdriver.
    But, if you really want to do it this way, the best thing to do is create a wrapper class that directly calls the system command and captures the output to a stringbuffer. Then your JSP page simply has to clone that wrapper via a new() command and trigger it if you go the singleton route. The code would look something like this...
    <%@ import page="com.mpalfrey.shellcommands.ping" %>
    <%
       myPing foo = new myPing( request.getParameter( "victim" ) );
       foo.trigger();
    %>
    Ping results:
    <%=foo.results()%>JSP can do a lot of wonderful things, but that doesn't mean you have to do it that way. :)

  • Help with Captions, within Slideshows

    I'm struggling with trying to figure out how to customize the size and location of caption boxes, within each image of a slideshow. It seems that, once an initial caption box has been set in the first image, it appears in all consecutive images at the same location and size, with no means of individually controlling them. Am I overlooking something? Is there a way to customize the size and location of all captions within one slideshow? Your help/advise would be greatly appreciated.  ~Thank you

    hi DubuqueIA,
    what do you mean by "Follow the same steps given under "Slideshow with thumbnail" tu updated captions" ?? where are these steps?
    i btw have the same problem: edit together active or not - it always changes the size of all my captions. i just want one of my captions to be wider.

  • Help with displaying errors in jsp using html:errors/

    Here is my problem.
    In my overridden ActionForm.validate() method, i am returning ActionErrors (as required). When there are input errors in my form submission, the control goes back to the JSP page i used to read user input (so far so good). The JSP page is rendered fine for taking input for the second time but no errors are displayed although i am using the tag <html:errors/>
    I tried to find the org.apache.struts.action.ERROR in my request attributes and it is there with the size of 1 (because i am reporting one error, in my sample run). Any idea why <html:errors/> won't display the errors even though they are there??? Here is what i am doing in my ActionForm class:
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    if (this.email == null || this.email.length() < 1) {
    errors.add("username", new ActionError
    ("error.username.required"));
    return errors;
    Any help is appreciated.

    First of all, thanks for taking time to look at my message. Here is how my message-resources tag look like in struts-config.xml file:
    <message-resources parameter="ApplicationResources"/>
    The "ApplicationResources.properties" file exist in the WEB-INF folder of my application and following are the entries in that file that i think are relevant:
    errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
    errors.footer=</ul><hr>
    error.username.required=<li>Username is required</li>
    Is there anything else needed to go into resource file? Or should i put my resource file somewhere else?

  • Help with buttons on a JSP Page

    Hi All,
    I have a HTML page , that has certain text fields.... on entering values into the text fields, it is directed to a servlet.
    The servlet(puts the values into the database) then directs to a jsp with the values entered in the form.
    I would like to know whether on the jsp page i can have 2 buttons like "edit" and "OK".
    (how do I code it???)
    The "edit" button edits the information on the initial HTML page and
    The "OK" button just confirms the inputted information.
    I hope I have asked a clear question.It would be great if someone directs me in the right direction.
    Thanking everyone in advance
    AS

    I hope I've understood your question correctly. Let
    me see if I got it right. So the first page is the
    form, where the user inputs the information, the
    second page will display this information that they
    inputted from the previous page and then have two
    buttons, one that says edit and the other that says
    ok. Upon hitting edit they're sent back to the form
    with the values already filled out, if they hit OK,
    the data is inserted into the database. If this is
    correct, this is how I would do it.
    You will have 3 files
    parameters.jsp
    <%
    String firstname =
    = request.getParameter("firstname");
         String lastname = request.getParameter("lastname");
    %>form.jsp
    <%@ include file="parameters.jsp">
    <html>
         <body>
              <form action="confirmation.jsp" method="post">
    <input type="text" name="firstname" value="<%=
    <%= firstname %>">
    <input type="text" name="lastname" value="<%=
    <%= lastname %>">
                   <input type="submit">
              </form>
         </body>
    </html>confirmation.jsp
    <%@ include file="parameters.jsp">
    <html>
         <body>
    <!-- the action of this form will be the page that
    at inserts the data into the database -->
              <form action="insertintodb.jsp" method="post">
    <input type="text" name="firstname" value="<%=
    <%= firstname %>">
    <input type="text" name="lastname" value="<%=
    <%= lastname %>">
                   <input type="submit" value="OK">
              </form>
              <form action="form.jsp" method="post">
    <input type="hidden" name="firstname" value="<%=
    <%= firstname %>">
    <input type="hidden" name="lastname" value="<%=
    <%= lastname %>">
                   <input type="submit" value="Edit">
              </form>
         </body>
    </html>
    Hi,
    Thanks a lot for the information.I will try to do as you have suggested.Will post when i go into problems...
    Many thanks
    AS

  • Need help with paint() within applet

    Hi,
    I am having some problems in using the paint() method within an applet.
    I need to use drawString() in the paint() method.
    However, I discovered that when i used drawString() in paint() method.
    It clears the background which has other GUI components wipe out.
    Pls help, thanx
    Sample code:
    public class watever extends javax.swing.JApplet {
    //initialize some components and variables
    public void init() {
    //adding of components to contentPane
    public void paint(Graphics g) {
    g.drawString("The variable is " + sum, 80, 80);
    }

    super.paint(g) the paint method draws the components to, so if you override it and then never tell it to draw the components they don't get drawn.

  • Help With Integrating Servlet and JSP Page?

    Hello There
    --i made jsp page that contain name and description fields and add button
    --and i made servlet that contain the code to insert name and description in the database
    --and i want to make that when the user hit the add button
    -->the entered name and description is sent to the servlet
    and the servlet sent them to database?
    here's what i 've done:
    the jsp code:
    <html:html locale="true">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>
            Categories Page
           </title>
            <html:base/>
        </head>
        <body style="background-color: white">
        <form action="jpage.jsp" method="get">
            <h1>
                <center>
    categories Operations
                </center>
            </h1>
            <h3>
                 <label>Name</label>
            <input type="text" name="name" value="" size="10" />
                 <label>Description</label>
             <input type="text" name="description" value="" size="10" />
             <input type="submit" value="Add" name="button" />
           </h3>
       </form>
        </body>
    </html:html>the servlet code:
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.net.*;
    class NewServlet1 extends HttpServlet{
         Connection conn;
         private ServletConfig config;
    public void init(ServletConfig config)
      throws ServletException{
         this.config=config;
    public void service (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
       HttpSession session = req.getSession(true);
       res.setContentType("text/html");
    try{
         Class.forName("com.mysql.jdbc.Driver");
       conn = DriverManager.getConnection("jdbc:mysql://localhost/struts", "root", "");
         PreparedStatement ps;
       ps = conn.prepareStatement ("INSERT INTO categories (Name, Description) VALUES(?,?)");
          ps.setString (1, "aa");
          ps.setString (3, "bb");
          ps.executeUpdate();
          ps.close();
          conn.close();
      }catch(Exception e){ e.getMessage();}
      public void destroy(){}
    }

    The JSP Code:
    <html:html locale="true">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>
            Categories Page
           </title>
            <html:base/>
        </head>
        <body style="background-color: white">
        <form action="actionServlet.do?action=Additem" method="*post*">
            <h1>
                <center>
    categories Operations
                </center>
            </h1>
            <h3>
                 <label>Name</label>
            <input type="text" name="name" value="" size="10" />
                 <label>Description</label>
             <input type="text" name="description" value="" size="10" />
             <input type="button" value="Submit">
           </h3>
       </form>
        </body>
    </html:html>The Servlet Code:
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.net.*;
    public class NewServlet1 extends HttpServlet implements SingleThreadModel {
        public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException {
            doPost(request,response);
        public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException {
              String action = request.getParameter("action"); // action = "Additem"
              if (action.equals("Additem")) {
                   String name = request.getParameter("name");
                   String description = request.getParameter("description");
                         RequestDispatcher reqDisp = null;
                   try{
                  Connection conn;
                  PreparedStatement ps;
         Class.forName("com.mysql.jdbc.Driver");
       conn = DriverManager.getConnection("jdbc:mysql://localhost/struts", "root", "");
       ps = conn.prepareStatement ("INSERT INTO categories (Name, Description) VALUES(?,?)");
          ps.setString (1, name);
          ps.setString (3, description);
          ps.executeUpdate();
          ps.close();
          conn.close();
          reqDisp= request.getRequestDispatcher("./index.jsp");
          reqDisp.forward(request, response);
                   catch (Exception ex){
                        System.out.println("Error: "+ ex);
    }The web.xml code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>
            <init-param>
                <param-name>debug</param-name>
                <param-value>2</param-value>
            </init-param>
            <init-param>
                <param-name>detail</param-name>
                <param-value>2</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
            </servlet>
        <servlet>
            <servlet-name>NewServlet1</servlet-name>
            <servlet-class>NewServlet1</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>NewServlet1</servlet-name>
            <url-pattern>/NewServlet1</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
            </welcome-file-list>
            <servlet>
         <servlet-name>actionServlet</servlet-name>
         <servlet-class>com.test.servlet.NewServlet1</servlet-class>
    </servlet>
    <servlet-mapping>
         <servlet-name>actionServlet</servlet-name>
         <url-pattern>*.do</url-pattern>
    </servlet-mapping>
        </web-app>

  • Help with search within pl/sql code

    Hi All,
    Can you please help me to find all the objects with a database link.
    I have some procedures,function and packages which uses database link. I need to fetch all the objects that uses a database link. Is there any way to get the list of object names using any database link?
    Thanks in advance
    Apppreciate your help!
    Thanks
    Bob

    hi there,
    the problem with dba_source is that the code might be wrapped.
    another possibility is to query dba_dependencies, column referenced_link
    Also you can have pl/sql routines that create dynamically code and might use dblinks in their dynamic code.
    So you might not be able to be 100 percent complete.
    HTH Mathias

Maybe you are looking for

  • Runtime Error in MMBE- s yntax error occurred in program "SAPLMBBS " in inc

    Hi Gurus, Runtime Error in "MMBE" Transaction - The following syntax error occurred in program "SAPLMBBS " in include "LMBBSU07 " in line 76: "The column name "MATNR" has two meanings . ." Any Input is Highly appreciated. Thanks and Regards, Selva

  • Are there any current widespread outstanding issues for the iPod touch 3G?

    I'm upgrading from a first-gen iPod touch because despite my whole-hearted love for it, its slighter faults like relatively short battery life and limited space, not to mention the fact that it recently likes borking all my headphones, have led me to

  • Idocs are not merging in BPM

    Hi Experts,         I am doing one scenario for merging the Idocs data in BPM and sending this one as file.I have done the following steps in BPM A. Loop with infinite     1.Receive     2.Container Operation(Append)     3.Container Operation(Assign)

  • Shortcuts for previous/next page on german keyboard are unreliable

    Hi there! I'm struggeling with the previous/next page shortcut on my german MacBook Pro. When I open the "History" menu it says the command for "next page" is ⌘ + ] and "previous page" is ⌘ + [ But there are no such bracket keys on the german keyboar

  • JRE  Detection in Internet Explorer

    Hi All, How can I detect the JRE version installed using Internet Explorer?. What if the the JRE is not installed,and so detect the default VM in Internet Explorer ?. I went though many articles, and looks like there is no standard way?. For Firefox