JSF Form Action

My application uses a URL structure similar to http://webaddress.com/org/user/edit
I have a form on the page http://webaddress.com/org/user/edit similar to the following:
<h:form id="formName">
      <!-- Form fields... -->
</h:form>When the form is rendered, the action tag is incorrect. The form tag is rendered as follows:
<h:form id="formName" action="/org/WEB-INF/pages/user/edit.xhtml" ...>
      <!-- Form fields... -->
</h:form>When it should be:
<h:form id="formName" action="/org/user/edit" ...>
      <!-- Form fields... -->
</h:form>How can I change the way the action tag is generated? This seems like a simple configuration issue, but I don't know where to start.

I am using Spring's UrlBasedViewResolver, which maps a request to /user/edit to the file /WEB-INF/pages/user/edit.xhtml
<bean id="faceletsViewResolver"
         class="org.springframework.web.servlet.view.UrlBasedViewResolver">
         <property name="viewClass" value="org.springframework.faces.mvc.JsfView" />
         <property name="prefix" value="/WEB-INF/pages" />
         <property name="suffix" value=".xhtml" />
</bean>

Similar Messages

  • Jsf h:form action

    How can I set a parameter action to form. I want to have html code:
    <form name="test" action="testaction.jsp?sth=2" method="post">
    ....but I can't give action parameter to <h:form action .. . I'm getting this error:
    Unable to locate tag attribute info for tag attribute action
    please help me.

    How can I set a parameter action to form. I want to have html code:
    <form name="test" action="testaction.jsp?sth=2" method="post">
    ....but I can't give action parameter to <h:form action .. . I'm getting this error:
    Unable to locate tag attribute info for tag attribute action
    please help me.

  • How to change the fields in a JSF form based on a URL parameter

    I am trying to build a generic JSF form of parameters which I want to dynamically change (i.e.
    change which field is visible, what the label text should be, etc) based on a URL parameter.
    I can set the fields using logic in the backing bean as an action on a command button pressed.
    But how do I do it based on the URL parameter ? I can retrieve the URL parameter but I
    don't know where to put (or hook) the Java code to do this initialization prior to
    the page being rendered for the first time.
    The fields in the JSF is being configured dynamically using a database table.
    BTW I am using Jdeveloper 10.1.3.5
    Thanks
    CK

    Thanks. I decided to set a Session bean to store the value of the URL parameter (if it is set)
    and then to use the session bean to initialize the attributes of the fields on the JSF Page.
    There also seems to be some caching of the inputText fields (i.e. it reverts back to the first
    initialized value) even though I tried to change it using the URL parameter in the requestScope
    backing bean. So, setting the values into the Session bean and retrieving it back from there
    seems to be more reliable.

  • Regarding JSF Default action problem in IE

    Hi,
    I am using Jsf:Default action inside my submit button.In my form I have row of two buttons submit and reset.When I use my tab focus on reset button and when I am clicking enter submit default action is getting fired rather reset action.More over if I am using spacebar after tab focus reset button is called as expected.The problem identified is only with IE browsers
    In case of Mozilla,default action is overridden by tab focus action and working properly.
    Please advise me how to solve this issue in IE
    Note:The j4j:defaultAction custom component included in the j4j tag libraries allows you to define the default action for a form by adding <j4j:defaultAction /> as a child tag to the commandButton tag.
    http://www.jsftutorials.net/defaultActionTag.html
    Edited by: Ravishankar_R on Mar 24, 2010 12:09 AM

    Amit,
    Thanks for your answer. I fixed it using javascript .First I got all the buttons in the DOM and did a check to find if there is any current focus using document.activeElement.type="button" else to go with default submit action.
    Thanks,
    Ravi

  • Submiting JSF form on clicking ok of Confirm dialog box

    Hi,
    We are using JSF 1.2 and Seam 2 in our project.
    We have set of requirements
    1)To throw a confirmation dialog box when user tries to navigate away from page with out saving the data changes. It includes browser closure, back button and refresh as well along with other application navigation links.
    2) upon clicking ok we need to save the current JSF form and redirect to where user is intended to navigate.
    Please let me know the best ways of implementing the above requirements.

    For the first point, I totally agree with Raymond and you can use the javascript function like this:
    <script>
    window.onbeforeunload =
    function(){
    if((window.event.clientX<0) || (window.event.clientY<0)){
    //create new confirm window here
    //I guess you can check on opening a new JSF page itself as a pop up.
    //in that page with normal form and submit buttons, I guess you can call JSF action methods.
    </script>

  • Question about creating Custom JSF form tag and renderer

    Is it possible to build a custom form tag in JSF and have it replace the standard jsf form tag. Are there any potential issues with child forms or anything else.
    I created the following
    - custom form component class that extends javax.faces.component.UIForm (the only changes I made was to change the value of the COMPONENT_TYPE attribute and change the value for renderer type)
    - custom form renderer class that extends HtmlBasicRenderer and I made changes to the encodebegin method and encrypt the value of the id and action url)
    - custom form tag class that extends UIComponentELTag ( I did not make any changes here)
    - tld for my custom form tag
    - created an entry in faces-config.xml of my web-app for my custom form tag
    Are there any issues with the above.
    Is there something I should do in addition.

    In theory you should be fine. Some of the open source libraries either swap out the renderer for the standard h:form component or supply their own form components. You could look at their code for reference if need be.

  • Unable to get the "Submit a form" action working with Webmail: Gmail

    I am attempting to create interactive PDF forms for the website which the end user will email back once filled out.
    I have added a link to the form that runs the "Submit a form" action, this appears to work if you have a mail client installed, but if you specify Webmail "Gmail", the system appears to start the process with:
    First asking you for the email account details to add
    You are then asked to allow Adobe Acrobat permissions to your access your email account
    It then attempts to create a draft message but fails with:  "Error while creating message ..."
    NB: I have logged into my Gmail account on the client PC and I am able to send emails.
    Any ideas if this has a known problem and if a fix is available, without a fix it makes interactive PDF's a bit pointless?
    Message was edited by: Neil Newman

    Hi Aniket,
    To the Clusters .. do you mean at the j2ee engine side?can you please give me info in detail
    Thnx for valuable inputs
    Vijay
    Message was edited by:
            NR

  • Problems with file uploading servlet, the form action doesnt capture url

    Hi, i have one problem. I am working on a project , i have created a servlet that takes uploaded files and processses them and links them back to user to download. The servlet works perfectly from my computer, I am using apache-tomcat-6.0.16 and java 1.6 , I have two forms called encrypt.html and decrypt.html, I will post both of them, now the problem is when somebody access it on the internet while i am running apache, they get a connection was reset on a firefox browser and same stuff on Internet Explorer.
    i have checked my server logs and saw nothing unusual there, So please if you can help me, it is my project.
    I am pasting html file and error message that other users where getting remotely.
    <html>
    <head>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
    <title>Stego Form</title>
    <link rel='STYLESHEET' type='text/css' href='encrypt.css'>
    </head>
    <body>
    <center>
    <form name='encrypt' enctype='multipart/form-data' method='POST' action='http://localhost:8080/examples/temp2
    ' accept-charset='UTF-8'>
    <input type='hidden' name='sfm_form_submitted' value='yes'>
    </input>
    <input type='hidden' name='eord' value='e'>
    <select name='encryption' size='1'>
             <option value='Select an encryption' selected>
             Select an encryption
             </option>
             <option value='DES'>
             DES
             </option>
             <option value='Tripple DES'>
             Tripple DES
             </option>
    </select>
             <input type='file' name='overt' size='20'>
             <input type='file' name='covert' size='20'>
             <input type='submit' name='submit' value='Submit'>
    </form>
    </center>
    </body>
    </html>so it works for me even if i access the page with my ip , but for others it doesnt work,
    now the user got this xhtml page that i will show, i cant find attach button so i am pasting here.
    here is the servlet coding
    import java.io.*;
    import java.util.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.*;
    import org.apache.commons.fileupload.*;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    public class temp2 extends HttpServlet
        FileInputStream fin;
        String filenames[] = new String[2],fieldname,fieldval;
        String keyfile,IVfile;
        String names[] = new String[2];
        public temp2()
            super();
        @Override
        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
            doPost(request, response);
        @Override
        public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
            String eord="";
            List lst = null;
            boolean isMultiPart = ServletFileUpload.isMultipartContent(request);
            if (!isMultiPart) // check whether the post request is actually multipart
                System.out.println("ERROR NOT MULTIPART");
                System.exit(0);
            DiskFileItemFactory fif = new DiskFileItemFactory();
            ServletFileUpload sfu = new ServletFileUpload(fif);
            sfu.setSizeMax(10000000);
            try {  lst = sfu.parseRequest(request);  }
            catch (FileUploadException ex)
            { System.out.println("ERROR IN PARSING FILES" + ex); System.exit(0);  }
            if(lst.isEmpty())  // check whether request is empty
                System.out.println("ERROR LIST SIZE NOT GOOD : " + lst.size());
                System.exit(0);
            Iterator x = lst.iterator();
            int i = 0;
            FileItem f = (FileItem)x.next();
            f = (FileItem)x.next();
            System.out.println(f.getFieldName());
            if(f.getFieldName().equalsIgnoreCase("eord")) // check hidden field to know the case : encrypt or decrypt
                eord = f.getString();
                System.out.println(f.getString());
            else // if it is not first field exit
                System.out.println("Invalid FORM");
                System.exit(0);
            f = (FileItem)x.next(); // next field
            if(f.getFieldName().equalsIgnoreCase("encryption")) // type of encryption des / tdes
                fieldname = f.getFieldName();
                fieldval = f.getString();
                System.out.println(f.getString());
            if(eord.equalsIgnoreCase("e")) // if it is encryption form only file required
                while(x.hasNext())
                    f = (FileItem)x.next();
                    if(!f.isFormField())
                        int check = f.getName().lastIndexOf(File.separator);
                        System.out.println(File.separator);
                        if(check==-1)
                            System.out.println(f.getName());
                            System.out.println("Unsupported browser : " + check);
                            System.exit(0);
                        File ff = new File("e:\\apache\\webapps\\temp\\"+f.getName().substring(check));
                        names[i] = ff.getName(); // original file names
                        try
                            f.write(ff);
                            filenames[i] = ff.getAbsolutePath();
                        // renamed    
                            ff.deleteOnExit();
                        }catch(Exception e) {System.out.println("Error writing file"+ ff.getAbsolutePath()); System.exit(0);}
                        i++;
                    try { System.in.read(); } catch(Exception e) {}
                }// endwhile
                if(fieldval.equalsIgnoreCase("DES"))
                    System.out.println("DES 1"+filenames[1]);
                    javades o = new javades(filenames[1]); // the file to be encrypted   
                    filenames[1] = "e:\\apache\\webapps\\temp\\files\\" + names[1];
                    System.out.println("should be original" + filenames[1]);
                else if(fieldval.equalsIgnoreCase("Tripple DES"))
                    javatdes o = new javatdes(filenames[1]);
                    filenames[1] = "e:\\apache\\webapps\\temp\\files\\" + names[1];
                    System.out.println(filenames[1]);
                System.out.println("Calling stego");
                filenames[0] = "e:\\apache\\webapps\\temp\\" + names[0];
                System.out.println("file 1 "+ filenames[0]);
                System.out.println("file 2"+ filenames[1]);
                try { System.in.read(); } catch(Exception e) {}
                stego s = new stego(filenames[0],filenames[1]);
                System.out.println("mainext " + s.mainext);
                // encryption done, and new files are loaded, now lets hide
                if(s.mainext.equalsIgnoreCase("wav"))
                    s.encodewav();
                    System.out.println("Encoded wave");
                else if(s.mainext.equalsIgnoreCase("bmp"))
                    System.out.println("Encoded bmp");
                    s.encodebmp();
                System.out.println("done !");
                PrintWriter pr = response.getWriter();
                pr.println("Greetings , Your work is done and saved, now download the following files");
                pr.println("The secret key file is needed for getting back your hidden file, so download that too");
                pr.write("<a href=\"/temp/files/IV.txt\">click here</a>");
                pr.write("<br/><a href=\"/temp/files/key.txt\">click here</a>");
                pr.write("<br/><a href=\"/temp/files/"+names[0]+"\">click here</a>");
                return;
            // if it is decryption case
            else if(eord.equalsIgnoreCase("d"))
                while(x.hasNext())
                    f = (FileItem)x.next();
                    if(!f.isFormField())
                        int check = f.getName().lastIndexOf(File.separator);
                        System.out.println(File.separator);
                        if(check==-1)
                            System.out.println(f.getName());
                            System.out.println("Unsupported browser : " + check);
                            System.exit(0);
                        File ff = new File("e:\\apache\\webapps\\temp\\"+f.getName().substring(check));
    // else if ladder to store paths of stegofile keyfile and IVfile                   
                        if(f.getFieldName().equalsIgnoreCase("stegofile"))
                            filenames[0] = ff.getAbsolutePath();
                        else if(f.getFieldName().equalsIgnoreCase("keyfile"))
                            keyfile = ff.getAbsolutePath();
                        else if(f.getFieldName().equalsIgnoreCase("IVfile"))
                            IVfile = ff.getAbsolutePath();
                        try
                            f.write(ff); // writes whole file at once
                        }catch(Exception e) {System.out.println("Error writing file"); System.exit(0);}
                }// endwhile
                System.out.println("Calling stego");
                System.out.println("file 1 "+ filenames[0]);
                stego s = new stego(filenames[0]);
                System.out.println("mainext " + s.mainext);
                if(s.mainext.equalsIgnoreCase("wav"))
                    s.decodewav();
                    System.out.println("Encoded wave");
                else if(s.mainext.equalsIgnoreCase("bmp"))
                    s.decodebmp();
                    System.out.println("Encoded bmp");
                System.out.println("done !");
                ////// hidden file has been retrieved , now lets decrypt it
                System.out.println("ext " + s.ext);
                filenames[0] = "e:\\apache\\webapps\\temp\\"+s.filename;
                System.out.println(filenames[0]);
                System.out.println(keyfile);
                System.out.println(IVfile);
                if(fieldval.equalsIgnoreCase("DES"))
                    javades o = new javades(filenames[0],keyfile,IVfile); // the file to be encrypted   
                    filenames[0] = "e:\\apache\\webapps\\temp\\" + ( new File(filenames[0]).getName());
                    System.out.println("should be original" + filenames[0]);
                else if(fieldval.equalsIgnoreCase("Tripple DES"))
                    javatdes o = new javatdes(filenames[0],keyfile,IVfile);
                    filenames[0] = "e:\\apache\\webapps\\temp\\" + ( new File(filenames[0]).getName());
                    System.out.println(filenames[0]);
                PrintWriter pr = response.getWriter();
                pr.write("Greetings, you have successfully retrieved your hidden file, now download it from here <br>");
                pr.write("<a href=\"http://localhost:8080/temp/files/" + (new File(filenames[0]).getName())+"\">Click here</a>");
    }and here is the xhtml file the user receives, whe he clicks the submit button,
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html [
      <!ENTITY % htmlDTD
        PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "DTD/xhtml1-strict.dtd">
      %htmlDTD;
      <!ENTITY % netErrorDTD
        SYSTEM "chrome://global/locale/netError.dtd">
      %netErrorDTD;
    <!ENTITY loadError.label "Problem loading page">
    <!ENTITY retry.label "Try Again">
    <!-- Specific error messages -->
    <!ENTITY connectionFailure.title "Unable to connect">
    <!ENTITY connectionFailure.longDesc "&sharedLongDesc;">
    <!ENTITY deniedPortAccess.title "This address is restricted">
    <!ENTITY deniedPortAccess.longDesc "">
    <!ENTITY dnsNotFound.title "Server not found">
    <!ENTITY dnsNotFound.longDesc "
    <ul>
      <li>Check the address for typing errors such as
        <strong>ww</strong>.example.com instead of
        <strong>www</strong>.example.com</li>
      <li>If you are unable to load any pages, check your computer's network
        connection.</li>
      <li>If your computer or network is protected by a firewall or proxy, make sure
        that &brandShortName; is permitted to access the Web.</li>
    </ul>
    ">
    <!ENTITY fileNotFound.title "File not found">
    <!ENTITY fileNotFound.longDesc "
    <ul>
      <li>Check the file name for capitalization or other typing errors.</li>
      <li>Check to see if the file was moved, renamed or deleted.</li>
    </ul>
    ">
    <!ENTITY generic.title "Oops.">
    <!ENTITY generic.longDesc "
    <p>&brandShortName; can't load this page for some reason.</p>
    ">
    <!ENTITY malformedURI.title "The address isn't valid">
    <!ENTITY malformedURI.longDesc "
    <ul>
      <li>Web addresses are usually written like
        <strong>http://www.example.com/</strong></li>
      <li>Make sure that you're using forward slashes (i.e.
        <strong>/</strong>).</li>
    </ul>
    ">
    <!ENTITY netInterrupt.title "The connection was interrupted">
    <!ENTITY netInterrupt.longDesc "&sharedLongDesc;">
    <!ENTITY netOffline.title "Offline mode">
    <!ENTITY netOffline.longDesc "
    <ul>
      <li>Uncheck "Work Offline" in the File menu, then try again.</li>
    </ul>
    ">
    <!ENTITY netReset.title "The connection was reset">
    <!ENTITY netReset.longDesc "&sharedLongDesc;">
    <!ENTITY netTimeout.title "The connection has timed out">
    <!ENTITY netTimeout.longDesc "&sharedLongDesc;">
    <!ENTITY protocolNotFound.title "The address wasn't understood">
    <!ENTITY protocolNotFound.longDesc "
    <ul>
      <li>You might need to install other software to open this address.</li>
    </ul>
    ">
    <!ENTITY proxyConnectFailure.title "The proxy server is refusing connections">
    <!ENTITY proxyConnectFailure.longDesc "
    <ul>
      <li>Check the proxy settings to make sure that they are correct.</li>
      <li>Contact your network administrator to make sure the proxy server is
        working.</li>
    </ul>
    ">
    <!ENTITY proxyResolveFailure.title "Unable to find the proxy server">
    <!ENTITY proxyResolveFailure.longDesc "
    <ul>
      <li>Check the proxy settings to make sure that they are correct.</li>
      <li>Check to make sure your computer has a working network connection.</li>
      <li>If your computer or network is protected by a firewall or proxy, make sure
        that &brandShortName; is permitted to access the Web.</li>
    </ul>
    ">
    <!ENTITY redirectLoop.title "The page isn't redirecting properly">
    <!ENTITY redirectLoop.longDesc "
    <ul>
      <li>This problem can sometimes be caused by disabling or refusing to accept
        cookies.</li>
    </ul>
    ">
    <!ENTITY unknownSocketType.title "Unexpected response from server">
    <!ENTITY unknownSocketType.longDesc "
    <ul>
      <li>Check to make sure your system has the Personal Security Manager
        installed.</li>
      <li>This might be due to a non-standard configuration on the server.</li>
    </ul>
    ">
    <!ENTITY sharedLongDesc "
    <ul>
      <li>The site could be temporarily unavailable or too busy. Try again in a few
        moments.</li>
      <li>If you are unable to load any pages, check your computer's network
        connection.</li>
      <li>If your computer or network is protected by a firewall or proxy, make sure
        that &brandShortName; is permitted to access the Web.</li>
    </ul>
    ">
      <!ENTITY % globalDTD
        SYSTEM "chrome://global/locale/global.dtd">
      %globalDTD;
    ]>
    <!-- ***** BEGIN LICENSE BLOCK *****
       - Version: MPL 1.1/GPL 2.0/LGPL 2.1
       - The contents of this file are subject to the Mozilla Public License Version
       - 1.1 (the "License"); you may not use this file except in compliance with
       - the License. You may obtain a copy of the License at
       - http://www.mozilla.org/MPL/
       - Software distributed under the License is distributed on an "AS IS" basis,
       - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
       - for the specific language governing rights and limitations under the
       - License.
       - The Original Code is mozilla.org code.
       - The Initial Developer of the Original Code is
       - Netscape Communications Corporation.
       - Portions created by the Initial Developer are Copyright (C) 1998
       - the Initial Developer. All Rights Reserved.
       - Contributor(s):
       -   Adam Lock <[email protected]>
       -   William R. Price <[email protected]>
       -   Henrik Skupin <[email protected]>
       -   Jeff Walden <[email protected]>
       - Alternatively, the contents of this file may be used under the terms of
       - either the GNU General Public License Version 2 or later (the "GPL"), or
       - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
       - in which case the provisions of the GPL or the LGPL are applicable instead
       - of those above. If you wish to allow use of your version of this file only
       - under the terms of either the GPL or the LGPL, and not to allow others to
       - use your version of this file under the terms of the MPL, indicate your
       - decision by deleting the provisions above and replace them with the notice
       - and other provisions required by the LGPL or the GPL. If you do not delete
       - the provisions above, a recipient may use your version of this file under
       - the terms of any one of the MPL, the GPL or the LGPL.
       - ***** END LICENSE BLOCK ***** -->
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>Problem loading page</title>
        <link rel="stylesheet" href="temp2_files/netError.css" type="text/css" media="all"/>
        <!-- XXX this needs to be themeable -->
        <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAANbY1E9YMgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAICSURBVHjaYvz//z8DJQAggJhwiDPvnmlzc2aR0O+JGezt+AwACCCsBhxfYhn59N41FWtXIxZOLu70niRGXVwGAAQQNgNYHj96O8HaWYdJW5ubwd4/mI2Ng7sblwEAAYRhwMm1URk/vn4SUNWVYGD8+YZBXZOZm5OLzRjoCmNsBgAEEKoBN82Y7l851GLrqMjM8Oc7A8O/3wwMP54wuAQFCXNycUzGZgBAAKEYcOaKZO2/f//5FbUVgBrfMoRVcgHpNwyKGjKMXDwCan0prFboBgAEELIBzDcvXyy2cVZhYPj9GWj7H4jo/38MDJ9OMDj7O/KzsjH3oxsAEEBwA/bNNipiZf7FI6cqwcDw8x2qqp8fGORUpVn4BEXlgGHhhCwFEEAwA9gfP3hdZ+Oizcjw+wvCdjgAuuLrFQbXIH9hTm7uqcgyAAEENuD4ctcebm5mbikFYRTbV7V/Q6j88Z5BSuY7q4CQgAjQFR4wYYAAAhtw89L5ZFsnRaDtn4CW/YXrAQcisit+PGVwDgrnZ2NnnwATBQggpsNLvGYLCAmxi8tLARWg+h3FBVBXSEj/ZZWQkRcCuiIQJAQQQCyvnj5KMDTkZ2JgYmRg4FchnHv+vmEwttLmeXT3VjKQtx4ggFgk5TXebV63UfT3ijOMxOZAVlZWdiB1EMQGCCBGSrMzQIABAFR3kRM3KggZAAAAAElFTkSuQmCC"/>
        <script type="application/x-javascript"><![CDATA[
          // Error url MUST be formatted like this:
          //   moz-neterror:page?e=error&u=url&d=desc
          // Note that this file uses document.documentURI to get
          // the URL (with the format from above). This is because
          // document.location.href gets the current URI off the docshell,
          // which is the URL displayed in the location bar, i.e.
          // the URI that the user attempted to load.
          function getErrorCode()
            var url = document.documentURI;
            var error = url.search(/e\=/);
            var duffUrl = url.search(/\&u\=/);
            return decodeURIComponent(url.slice(error + 2, duffUrl));
          function getDescription()
            var url = document.documentURI;
            var desc = url.search(/d\=/);
            // desc == -1 if not found; if so, return an empty string
            // instead of what would turn out to be portions of the URI
            if (desc == -1) return "";
            return decodeURIComponent(url.slice(desc + 2));
          function retryThis()
            // Session history has the URL of the page that failed
            // to load, not the one of the error page. So, just call
            // reload(), which will also repost POST data correctly.
            try {
              location.reload();
            } catch (e) {
              // We probably tried to reload a URI that caused an exception to
              // occur;  e.g. a non-existent file.
          function initPage()
            var err = getErrorCode();
            // if it's an unknown error or there's no title or description
            // defined, get the generic message
            var errTitle = document.getElementById("et_" + err);
            var errDesc  = document.getElementById("ed_" + err);
            if (!errTitle || !errDesc)
              errTitle = document.getElementById("et_generic");
              errDesc  = document.getElementById("ed_generic");
            var title = document.getElementById("errorTitleText");
            if (title)
              title.parentNode.replaceChild(errTitle, title);
              // change id to the replaced child's id so styling works
              errTitle.id = "errorTitleText";
            var sd = document.getElementById("errorShortDescText");
            if (sd)
              sd.textContent = getDescription();
            var ld = document.getElementById("errorLongDesc");
            if (ld)
              ld.parentNode.replaceChild(errDesc, ld);
              // change id to the replaced child's id so styling works
              errDesc.id = "errorLongDesc";
            // remove undisplayed errors to avoid bug 39098
            var errContainer = document.getElementById("errorContainer");
            errContainer.parentNode.removeChild(errContainer);
        ]]></script>
      </head>
      <body dir="ltr">
        <!-- ERROR ITEM CONTAINER (removed during loading to avoid bug 39098) -->
        <!-- PAGE CONTAINER (for styling purposes only) -->
        <div id="errorPageContainer">
          <!-- Error Title -->
          <div id="errorTitle">
            <h1 id="errorTitleText">The connection was reset</h1>
          </div>
          <!-- LONG CONTENT (the section most likely to require scrolling) -->
          <div id="errorLongContent">
            <!-- Short Description -->
            <div id="errorShortDesc">
              <p id="errorShortDescText">The connection to the server was reset while the page was loading.</p>
            </div>
            <!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
            <div id="errorLongDesc">
    <ul>
      <li>The site could be temporarily unavailable or too busy. Try again in a few
        moments.</li>
      <li>If you are unable to load any pages, check your computer's network
        connection.</li>
      <li>If your computer or network is protected by a firewall or proxy, make sure
        that Firefox is permitted to access the Web.</li>
    </ul>
    </div>
          </div>
          <!-- Retry Button -->
          <xul:button xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="errorTryAgain" label="Try Again" oncommand="retryThis();"/>
        </div>
        <!--
        - Note: It is important to run the script this way, instead of using
        - an onload handler. This is because error pages are loaded as
        - LOAD_BACKGROUND, which means that onload handlers will not be executed.
        -->
        <script type="application/x-javascript">initPage();</script>
      </body>
    </html>thank you for your prompt reply in advance,
    Regards,
    Mihir Pandya

    Hi, thank you for your replies, I found out few things about my servlet, and its portability
    and i have few questions, although i marked this topic as answered i guess its ok to post
    I am using javax.servlet.context.tempdir to store my files in that servletcontext temporary directory. But i dont know how to give hyperlink
    of the modified files to the user for them to download the modified files.
    What i am using to get the tempdir i will paste
    File baseurl = (File)this.getServletContext().getAttribute("javax.servlet.context.tempdir");
    System.out.println(baseurl);
    baseurl = new File(baseurl.getAbsolutePath()+File.separator+"temp"+File.separator+"files");
    baseurl.mkdirs();so i am storing my files in that temp/files folder and the servlet processes them and modifies them, then how to present them as
    links to the user for download ?
    and as the servlet is multithreaded by nature, if my servlet gets 2 different requests with same file names, i guess one of them will be overwritten
    And i want to create unique directory for each request made to the servlet , so file names dont clash.
    one another thing is that i want my servlet to be executed by my <form action> only, I dont want the user to simply type url and trigger the servlet
    Reply A.S.A.P. please..
    Thanks and regards,
    Mihir Pandya

  • How to send query string by using form action

    Hai to all,
    I am new to this topic Ihave one doubt about jsp form action....
    That is I am using input type is submit button
    <input type="submit" name="submit" value="Edit" onclick="indows.location.href=+sample.jsp?query=+editvalue+editname">
    If I get that queryString in the sample.jsp page it respoce to the null only...... what is the problem to this code ..... please send ur perfect coding as soon as possible. I really waiting for ur replay..........

    Hai,
    I think u can use the "request.getQueryString()" to get the query string instead of using "request.getParameter()".
    From the query string value u can get the output.
    cheers,
    Redrose

  • How to get jsp page form action this page use ajax

    i want to get form action result editThree div. however, ajaxpage open new window.how to decide it?
    ajaxCallPages.js
    var loadedobjects=""
    var loadingcontainer="loading"
    var loadstatustext="<img src='images/loading.gif' />" //loading
    var rootdomain="http://"+window.location.hostname
    function ajaxpage(url, containerid ){
    var page_request = false
    if (window.XMLHttpRequest) // if Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    else if (window.ActiveXObject){ // if IE
    try {
    page_request = new ActiveXObject("Msxml2.XMLHTTP")
    catch (e){
    try{
    page_request = new ActiveXObject("Microsoft.XMLHTTP")
    catch (e){}
    else
    return false
    document.getElementById(containerid).innerHTML=loadstatustext // loading
    page_request.onreadystatechange=function(){
    loadpage(page_request, containerid)
    page_request.open('GET', url, true)
    page_request.send(null)
    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    document.getElementById(containerid).innerHTML=page_request.responseText
    userEditIformation.jsp
    <script language="JavaScript" src="function/ajaxCallPages.js"></script>...
    <div id="editTwo">
    <table width=100% cellpadding=0 cellspacing=0 border=0>
    <tr>
    <td>
    <form name="myform" action="pages/editUser.jsp" method="post">
    <table width=100% cellpadding=0 cellspacing=0 border=0>
    <tr>
    <td>
    <table width=100% cellpadding=3 cellspacing=1 border=0 bgcolor="#cccccc">
    <tr valign=top>
    <td bgcolor="#666666" width=150 style="color:#FFFFFF;" align="right">User group:</td>
    <td bgcolor="#f5f5f5"> <select name="UserGroup" id="lgroup">
    <option>Administrator</option>
    <option>Editor</option></select>
    </td>
    </tr>
    <tr valign=top>
    <td bgcolor="#666666" width=150 style="color:#FFFFFF;" align="right">User name:</td>
    <td bgcolor="#f5f5f5"><input type="text" id="lname" name="uname" maxlength="20" value=""> </td>
    </tr>
    <tr valign=top>
    <td bgcolor="#666666" width=150 style="color:#FFFFFF;" align="right">E-Mail:</td>
    <td bgcolor="#f5f5f5"><input type="text" id="lmail" name="uemail" value="" onkeypress="return checkEnter(event);" onKeyPress="Comment = false; Email = true; PostalCode = false; Go();" onChange="this.value = ignoreSpaces(this.value);"></td>
    </tr>
    <tr valign=top>
    <td bgcolor="#666666" width=150 style="color:#FFFFFF;" align="right">New password:</td>
    <td bgcolor="#f5f5f5"><input type="password" id="lpass1" name="upass1" maxlength="20" value="" onkeypress="return checkEnter(event);" onKeyPress="Comment = true; Email = false; PostalCode = false; Go();" onChange="this.value = ignoreSpaces(this.value);"></td>
    </tr>
    <tr valign=top>
    <td bgcolor="#666666" width=150 style="color:#FFFFFF;" align="right">Verify password:</td>
    <td bgcolor="#f5f5f5"><input type="password" id="lpass2" name="upass2" maxlength="20" value="" onkeypress="return checkEnter(event);" onKeyPress="Comment = true; Email = false; PostalCode = false; Go();" onChange="this.value = ignoreSpaces(this.value);"></td>
    </tr>
    <tr valign=top>
    <td bgcolor="#666666" width=150 style="color:#FFFFFF;" align="right">Phone:</td>
    <td bgcolor="#f5f5f5"><input type="text" id="lphone" name="uphone" value="" onkeypress="return checkIt(event);" onChange="this.value = ignoreSpaces(this.value);"></td>
    </tr>
    <tr valign=top>
    <td bgcolor="#666666" width=150 style="color:#FFFFFF;" align="right">Block:</td>
    <td bgcolor="#f5f5f5">
    <table cellpadding=0 cellspacing=0 border=0>
    <tr>
    <td><input type="radio" name="ustatus" id="lradio1" value="1"></td><td>Yes </td>
    <td><input type="radio" name="ustatus" id="lradio2" value="0" ></td><td>No </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr valign=top>
    <td bgcolor="#666666" width=150 style="color:#FFFFFF;" align="right">Register date:</td>
    <td bgcolor="#f5f5f5"><%getDateTimeValue valueOne= new getDateTimeValue(); out.println(valueOne.getDateTime());</td>
    </tr>
    <tr valign=top>
    <td bgcolor="#666666" width=150 style="color:#FFFFFF;" align="right">Last visit date:</td>
    <td bgcolor="#f5f5f5"><%getDateTimeValue valueTwo= new getDateTimeValue(); out.println(valueTwo.getDateTime());</td>
    </tr>
    </table>
    </td>
    </tr>
    <tr><td> </td></tr>
    <tr><td><input type="button" onclick="ajaxpage('pages/editUser.jsp', 'editThree')" value="Send"/> </td></tr>
    <tr><td height=18 id="eoncmssend"></td></tr>
    </table>
    </form>
    </td>
    </tr>
    </table></div>
    <div id="editThree">
    </div>
    editUser.jsp
    <html>
    <head>
    <link rel="stylesheet" href="css/editUser.css" type="text/css"></link>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <%
    String ugroup=null;
    String phone=null;
    String name=null;
    if(request.getParameter("uname")!=null){
    name=request.getParameter("uname");
    if(request.getParameter("uphone")!=null)
    phone=request.getParameter("uphone");
    out.println(name);
    out.println(phone);
    %>
    </body>
    </html>
    ../

    From the HTTP spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html):
    14.36 Referer
    The Referer[sic] request-header field allows the client to specify, for the server's benefit, the address (URI) of the resource from which the Request-URI was obtained (the "referrer", although the header field is misspelled.) The Referer request-header allows a server to generate lists of back-links to resources for interest, logging, optimized caching, etc. It also allows obsolete or mistyped links to be traced for maintenance. The Referer field MUST NOT be sent if the Request-URI was obtained from a source that does not have its own URI, such as input from the user keyboard.
    Referer = "Referer" ":" ( absoluteURI | relativeURI )
    Example:
    Referer: http://www.w3.org/hypertext/DataSources/Overview.html

  • OAM: Form based auth IIS6, problem with form action

    This should be really simple, reading all the docs and forums, they all say that the form action should be
    /access/oblix/apps/webgate/bin/webgate.dll
    but this doesn't exist.
    Virtual dir /access points to
    c:\progfiles\netpoint\webcomponent\access
    in there, there is no webgate folder under apps
    I do find a webgate folder here:
    c:\progfiles\netpoint\webgate\access\oblix\apps\webgate\bin\webgate.dll
    I tried copying the webgate folder from the 2nd to the webcomponents one but getting a 404 when trying to access the webgate.dll. I can access a test.html file in that same folder.

    Hi,
    I believe the thread at Help with OAM Form login on IIS please should help.
    -Vinod

  • Jsf form to pdf file, how?

    Hi all how to transform a jsf form to a pdf to download?
    many thanks

    There is no such thing. Generally you use the print function of the browser - it is your job to properly apply css so a page prints nicely. Otherwise you have to dig into itext which is the api for producing pdf files.

  • WebHelp stripping out form action

    I have a form in my documentation where users may fill out questions, click a "Submit" button, and it is emailed to me. I remember testing this a few years ago and it worked great. Recently, someone contacted us to say he never heard back from his form. I then tested it, and it never was emailed to me. When I checked the HTML code, it's being stripped for some reason. I'm on the HTML tab, I type in the <form action="mailto..." > data. Then I click to the designer tab. When I click back to the HTML tab, it's gone! No sign of what I JUST typed! Here's the "naked" code:
    </head>
    <body>
    <robohelp><form>
    </robohelp>
    <robohelp><div align=left></robohelp>
    Where you see the <form>, I had just typed in the actual action part. It just disappears though. Further, the bottom part of the code, where the closing </form> tag is, that </form> disappears as well. I type it in, click off the tab, and get this:
    <p><input type=submit name=submit value="Send to Us"><input type=reset name=reset value="Start Over"></p>
    </body>
    </html>
    No </form> tag. Gone. I haven't even clicked Save or ANYTHING at this point. Any ideas why Robohelp would be stripping code like this? Much appreciated.

    Hi there
    By broken, I meant my crystal ball is broken (and sadly still is )
    When you visited the forums to post, I'm guessing you missed seeing this link? If so, please click it and give it a once over. See if that illuminates my reaction.
    Click image below for possibly larger view
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • How to use html form actions and methods

    Hi, I want to make a quick contact page using Edge. I used the following code in my creationComplete but had no luck.  Any help?
    var na = sym.$( "email" );
    email.html( '<form action="send_mail.php" method="post"><input type="text" id="email" value="" />' );
    var button = sym.$( "btn" );
    button.html( '<input type="submit" value="Send" />' );

    My understanding from your question is that you would like to programmatically (using LabVIEW) send input to and click a button on an existing HTML website, is that right?
    If yes, then you can use ActiveX calls to embed a web browser into the front panel of your VI and then use its invoke node to input a text to a form or click a button. Another way is to use the lower-level TCP VIs in LabVIEW, but you need to understand HTTP protocols to successfully use this. See below examples to get started.
    ActiveX
    https://decibel.ni.com/content/docs/DOC-25396
    https://decibel.ni.com/content/docs/DOC-12454
    TCP VIs (HTTP)
    https://decibel.ni.com/content/docs/DOC-2230
    http://zone.ni.com/devzone/cda/epd/p/id/3153
    FYI, LabVIEW Internet Toolkit has been deprecated starting LabVIEW 2012, so it is not recommended to build a new application using that.
    Hope this helps.
    Regards,
    A. Yodha
    Applications Engineer | National Instruments
    Singapore (65) 6226 5886 | Malaysia (60) 3 7948 2000 | Thailand (66) 2 298 4800
    Philippines (63) 2 659 1722 | Vietnam (84) 8 3911 3150 | Indonesia (62) 21 2924 1911

  • Htmlb form action

    Hi,
    I have a question about the "action" attribute of the htmlb form object.  Is it a relative or absolute path that the action attribute expects? 
      <hbj:form action="nextjsp.jsp">
      or
      <hbj:form action="pagelet.jsp">
    I've tried the JSPDynPage example from the PDK, and the switch statements don't work on my button click.  I'm wondering how I can send my request to the correct JSP.  Thanks!
    -Vu

    Hi Vu,
    In this case you are using relative paths. An absolute path would look like:
    ... action="/nextjsp.jsp">
    Please note this is the root of the webserver (your portal instance).
    There are other tricks you can use like:
    ... action="../nextjsp.jsp">
    (relative, one directory below current one)
    Hope this helps.
    Noel

Maybe you are looking for