How to specify the servlet in the ACTION field in FORM in jsp, html pages?

I have problem when I return back to the page prova3.html from the servlet because in the address bar it give me this path:
http://192.168.161.209:8988/Workspace3-Project1-context-root/servlet/servlet/Servlet1
two times servlet/ why? and what I have to put in the action field?
This is my form in page prova3.html:
<form action="servlet/Servlet1" method="post" id="search" style="font: bold 80% Arial,sans-serif; color: #334d55;" >
<input type="hidden" name="pagina" value="1"/>
     user<input name="username" type="text" size="10" style="font-size: 12px;"/> 
password<input name="password" type="password" size="10" style="font-size: 12px;"/>
     <input name="login" type="submit" value="Login" style="font-size: 12px; font-family: Arial,sans-serif;"/>
</form>
The redirection form servlet to pages is:
private void toProvaPage(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
RequestDispatcher rd = getServletContext().getRequestDispatcher(
"/prova.jsp");
rd.forward(request, response);
private void toIndexPage(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
RequestDispatcher rd = getServletContext().getRequestDispatcher(
"/prova3.html");
rd.forward(request, response);
Thanks, but I can solve this problem.

This is my web.xml file where the mapping is specified, this is the thing that I can't understand.
<web-app>
<description>Empty web.xml file for Web Application</description>
<display-name>public_html</display-name>
<servlet>
<servlet-name>Servlet1</servlet-name>
<servlet-class>servlet.Servlet1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Servlet1</servlet-name>
<url-pattern>/servlet1</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
</web-app>
Thanks

Similar Messages

  • How to specify a variable in the path prefix of an External HTTP (RFC) connection (in transaction SM59)

    Hi There,
    Please can someone tell me how to specify a variable in the  path prefix of an External HTTP (RFC) connection in transaction SM59?
    For example if my path prefix is /invoke/test/example?input=XYZ; how do I replace "XYZ" with a variable so that I can pass in any value after "=" ?
    Thanks,
    Brendon

    Hi,
    This is SAP Business one system administration forum. Please find correct forum and repost above discussion to get quick assistance.
    Please close this thread here with helpful answer.
    Thanks & Regards,
    Nagarajan

  • How to specify multiple listeners in the init/spfile

    hi experts,
    can u explain me How to specify multiple listeners in the init/spfile ?

    you do not specify linsteners in spfile.
    The easiest way to configure more listeners is to use Net Configuration Assistant tool.

  • I need to get the value of a text field that is located in another page JSP

    I need to get the value of a text field that is located in another page JSP. How do I do that?

    Well you see, I have a page at angelfire.com, which
    does not support JSP. I want to call a script located
    at mycgisever and then, when pressing a link on the
    former page, the JSP page is loaded, and the script
    get the value from the text field on the OTHER page.
    Is this possible?I know nothing about cgi. But that should not prevent me from understanding what can and cannot be done, assuming cgi is sort of comparable with jsps.
    I'm unable to understand your description clearly. Try to explain it better. Give precise steps that you intend to follow and I should be able to help you further.
    So you have a page1.
    You hit submit from page1.
    That goes to the cgiserver.
    From the cgiserver, programmatically load up the jsp.
    search this for the text field.
    Display it on your page2.
    Is that what you are trying to do?
    BTW, won't be able to help you with cgi scripting at all. Can help with Java and Jsp.

  • What is the most efficient way to post several stories to multiple html pages

    What is the most efficient way to post five stories to multiple html pages?
    Currently they are all html files saved in DW with some divs sharing content and other divs are unique.
    I've experimented with saving stories as library items and dropping into other html but wondered if there is a more efficient or dynamic process.

    Server-Side Includes.
    http://forums.adobe.com/message/2112460#2112460
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • How to specify  a servlet mapping as the url pattern with in the security constraints

    Hi ,
    Weblogic 6.0 documentation says the following:-
    Define which resources in the Web Application the security constraint applies to using the <url-pattern> element that is nested inside the <web-resource-collection> element. The <url-pattern> can refer to either a directory, filename or a <servlet-mapping>.
    To apply the security constraint to the entire Web Application, use the following <url-pattern>:
    <url-pattern>/*</url-pattern>
    Could any one let me know how to specify servlet mapping as the url pattern.
    I tried various combination and it doesn't seem to work and any help in this regard will be greatly appreciated.
    Thanks
    kannan

    The answer is posted here:
    Unapproved User Flag in UME

  • How to specify a variable in the script logic

    I want to pass a variable from the process chain using the prompt statement.
    I  want to refer to the variable name in the script. When I used the following statement in the script file, I got an error when validating the statement below:
    //Increase Wage and Salary & Personnel Exp. by entered percentage
    [P_ACCT].[#CE0004020] = [P_ACCT].[CE0004020] * ( 1 + $WS_PERCT$ / 100)
    Syntax error:Reference Error: $WS_PERCT$  is not defined
    One of the how-to guides indicated that I should use the dollar sign before and after the variable name.
    Can someone explain how to specify a variable name in the script.
    Thanks.

    Thanks, Pravin.
    I tried using the syntax with the # sign (as shown below) but when I validate the code I get an error. The message indicates there is an issue with $WS_PERCT$.
    Syntax error:Reference Error: $WS_PERCT$ is not defined
    P_ACCT].[#CE0004020] = [P_ACCT].[CE0004020] * ( 1 + $WS_PERCT$ / 100)
    Can you please advise if am missing something here in the code.
    Edited by: Sanjay Kumar on Sep 24, 2009 10:06 PM
    Edited by: Sanjay Kumar on Sep 24, 2009 10:08 PM

  • How to specify delimiter when parsing the parameter list in URL

    Here is a sample URL used to call the servlet:
    http://myhost.com/servlet?param1=test1&param2=test2&param3=test3In the doGet method of my servlet, I understand I can use the getParameter method to retrieve the various parameter values:
    String p_param1 = request.getParameter("param1");
    String p_param2 = request.getParameter("param2");
    String p_param3 = request.getParameter("param3");However, what if the URL was of the form:
    http://myhost.com/servlet?param1=test1+param2=test2+param3=test3where the URL parameter delimiter was a plus sign rather than an ampersand (&).
    By default, the servlet is only recognizing the ampersand (&) as a parameter delimiter.
    When I use a plus sign as the delimiter, getParameter retrieves everything after the question mark (?) as the first parameter
    i.e. param1 = test1 param2=test2 param3=test3
    param2 = null
    param3 = null
    How can I get getParameter to recognize a plus sign (+) as a valid delimiter?

    Servlets follow the HTTP specification. So, there is not much you can do on that level. What you could do (though I do not recommend it) is to set-up a filter that will automatically swap the plus with an ampersand before the actual servlet processes it. My strong advice, however, is to give up on using a nonstandard delimiter.
    [http://java.sun.com/products/servlet/Filters.html]
    - Saish

  • How to invoke a servlet from the command line

    Hi,
    I have a process that needs to do something remotely. One of the ideas is to have a servlet on the other side that can do that. So the question is how can I invoke it from my process?
    Thanks,

    First approximation to code:URL remoteTask = new URL("http://yourserver.org/yourservlet");
    InputStream response = remoteTask.openStream();
    // read the servlet's response from that InputStreamYou will find more comprehensive versions of this code if you search the forum.

  • How does the servlet implement the multi-thread feature?

    There is only one instance of every servlet in one wep application.
    When several clients invoke the doPost() method of the same servlet,the servlet can process their request respectively.
    So there much multi threads of one servelt.
    But the Servlet doesn't implement the Runnable interface of extends the Thread class.
    I wan't to know,how does the servlet/servlet container implement the multi-thread feature?

    Hi johnnylzb
    There is only one servlet instance existing.
    (assuming u have <load-on-startup>1</load-on-startup>)
    The server creates a thread for every request ..
    and all the threads access the same servlet instance.
    For this its not necessary for the Servlet to extend Thread or Runnable.
    hope this helps

  • How to specify logfile size at the time of adding to a member.

    Hi All,
    I am in the process of upgrading Oracle 9.0 to 10.1.
    I am following manual upgrad process.As per the recomendation from the pre-upgrade information script,i need to recreate redo-log files.
    Logfiles: [make adjustments in the current environment]
    --> E:\ORACLE\ORADATA\PRODB229\REDO03.LOG
    .... status="INACTIVE", group#="1"
    .... current size="1024" KB
    .... suggested new size="10" MB
    --> E:\ORACLE\ORADATA\PRODB229\REDO02.LOG
    .... status="INACTIVE", group#="2"
    .... current size="1024" KB
    .... suggested new size="10" MB
    --> E:\ORACLE\ORADATA\PRODB229\REDO01.LOG
    .... status="CURRENT", group#="3"
    .... current size="1024" KB
    .... suggested new size="10" MB
    WARNING: one or more log files is less than 4MB.
    Create additional log files larger than 4MB, drop the smaller ones and then
    upgrade.i can add redo member by the below command,but not able to specicy the size as 10M.I did some googling but no luck with that..
    SQL> ALTER DATABASE ADD LOGFILE MEMBER 'E:\oracle\oradata\prodb229\REDO01.rdo' T
    O GROUP 1;
    but it fails
    ALTER DATABASE ADD LOGFILE MEMBER 'E:\oracle\oradata\prodb229\REDO01.rdo' TO GROUP 2 SIZE 10M;
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    ~Thnx

    If you add a logfile to an existing group, you cannot specify the size for that file.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_1004.htm#i2079942
    <quote>
    ADD [STANDBY] LOGFILE MEMBER Clause Use the ADD LOGFILE MEMBER clause to add new members to existing redo log file groups. Each new member is specified by 'filename'. If the file already exists, it must be the same size as the other group members, and you must specify REUSE. If the file does not exist, Oracle Database creates a file of the correct size. You cannot add a member to a group if all of the members of the group have been lost through media failure.
    <quote>

  • How to specify file names for the generated code in wscompile

    Hi,
    We want to follow a certain file naming conventions for the artifacts generated by wscompile.
    How is it possible to set the name for the service interface file, service implementation file etc....
    This is possible in AXIS ant task Wsdl2Java. How do we do it for wscompile.
    thanx

    Thanks Chris and c. Under Description I'm presented with three Names for the profile: ASCII, UniCode and Mac Script. ASCII and Mac Script are the same name for the profile, with nothing being in the UniCode Name box. Which do I change -- both?
    Am I going to screw things up in Photoshop if I change these names to something I can comprehend? Looks like I may just have to make a sticky-note list of the cryptic profile names with my own descriptive name as a reference. Thanks.

  • With iPlanet6.0 how can I include servlets in the cgi directory?

    I have created a cgi directory ex. http://hostname/cgi-bin to refer to the cgi.exe's. However.. I have developed a new servlet that replaces one of the cgi programs. The servlet context must fit in with our existing architecture so the servlets context must map to the cgi URL we have in place. This works fine with every web app server under the sun .. even Sun One7... but not on iPlanet 6.0. This is because it seems that every resource mapped by a CGI directory must be a CGI program - the web server doesn't have the intelligence to know that a servlet with the same context is available and so when the CGI directory is enabled... the servlet is not found, yet when it is removed the servlet is referenced just fine.
    Has anyone any ideas? Unfortunately I can't change the context of the servlet as our existing systems depend on the original cgi structure.
    Many thanks,
    Mark

    Right /cgi must reference a cgi and /servlet is for legacy servlets that arent deployed as applications.
    I dont think you are going to make it work like that, maybe do a redirect from /cgi/cginame to /servlet/servletname . That's the only thing that may work.

  • How to deploy a servlet on the internet

    Hi all, Please, i'll like to know if anyone has ever hosted a servlet. I'm not new to java but new to servlets. I already deployed my servlet using j2ee 1.4 and everything works perfectly on lacalhost but i'm stuck trying to upload it online. I have an apache server so where should i put the .ear file and others..
    Thank you in advance.

    I finally got deployed the servlet on my server but still have a little problem.. It works perfectly well on Internet Explorer but on mozilla firefox, it comes out in html code form like dis:
    *<html><head><title>TFSSEC ONLINE ACCOUNT</title><link rel=stylesheet href=style.css type=text/css charset=utf-8 /><style type=text/css><!--.style1 {font-size: 36px;font-weight: bold;font-family: Courier New, Courier, mono;}--></style></head><body bgcolor=#999999><br><br><center><u><font size=4>ACCOUNT INFORMATION FOR PATIENCE YESUFU<br><br></u></font><table align=center border=1 width=80% bgcolor=#003366 cellspacing =5 cellpadding =5><tr>*
    *<TH align=left>EFFDATE</TH>*
    *<TH align=left>ACCOUNTID</TH>*
    *<TH align=left>LEDGERTYPE</TH>*
    *<TH align=left>CREDIT</TH>*
    *<TH align=left>DEBIT</TH>*
    *<TH align=left>DEBCRED</TH>*
    *<TH align=left>DESCRIPTION</TH>*
    *<TH align=left>TRANSTYPE</TH>*
    *</TR>*
    *<TR>*
    *<TD><font color=white><strong>2007-10-02 00:00:00</TD></font></strong>*
    *<TD><font color=white><strong>00001</TD></font></strong>*
    *<TD><font color=white><strong>NGN</TD></font></strong>*
    *<TD><font color=white><strong>26830.349</TD></font></strong>*
    *<TD><font color=white><strong>0</TD></font></strong>*
    *<TD><font color=white><strong>C</TD></font></strong>*
    *<TD><font color=white><strong>STOCK SALE: 1300 PZ @ 21.2</TD></font></strong>*
    *<TD><font color=white><strong>STKBSALE</TD></font></strong>*
    *</TR>*
    please, can anybody help me...

  • Is there any way to call the servlet from the applet

    hi all,
    My problem is that i have a applet .After the applet completes execution a servlet should be invoked.Is it possible to do so.
    I also want to pass a string array to the servlet.
    Is it possible to pass a string array to aservlet.
    If yes please do inform me that method.
    And from that servlet we should be able to redirect the the response of the applet to the servlet or JSP.
    The flow is some what lILE THIS
    APPLET TO SERVLET TO SERVLET/JSP

    Stop double posting. It won't help
    http://forum.java.sun.com/thread.jspa?threadID=642015
    and take a look at this.
    http://www.google.com/search?hl=en&q=applet+servlet+communication

Maybe you are looking for