JSP/Servlet Feedback form confusion

Hi,
I hope someone can advise me. I have a jsp which collects feedback information from a form. I then want to call a java servlet to read this information, store it in a bean and send an email. At the moment when I click submit in the jsp form, the servlet isnt even being called.....Is it totally necessary for this kind of scenario that my servlet contain doget and dopost methods?
Many thanks.(code below)
//feedback jsp
<form action=sendfeedbackemailcontrolservlet>
          <br><br>
           <div align="centre"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#000066">
         <font face="Verdana, Arial, Helvetica, sans-serif" size="2">From:</font></font><font color="#000066"> 
              <input type="text" name="fromemail" size="40">
               <p align="left">  </p>
          Subject:
             </font> <font color="#000066">  
               <input type="text" name="subject" size="40">
               <br><br><br>
              <font size="2" face="Verdana, Arial, Helvetica, sans-serif">Comments/Suggestions:
               </font><br><br>
               <textarea rows=6 cols=34 name="suggestions" ></textarea>
               </font> </div>
                  <p align="left">  </p>
              <div align="centre">
                <input type="button" value="Submit Feedback" name="button">
             <input type="reset" value="Clear all" name="reset">
             </div>
     </form>
//feedback servlet
public class SendFeedbackEmailControlServlet extends HttpServlet {
  private static final String CONTENT_TYPE = "text/html";
  //Initialize global variables
  public void init() throws ServletException {
  public static void send(HttpServletRequest request, HttpServletResponse response, String smtpHost, int smtpPort,String from, String to,String subject, String content)throws AddressException, MessagingException {
             // Create a mail session
             java.util.Properties props = new java.util.Properties();
             props.put("mail.smtp.host", smtpHost);
             props.put("mail.smtp.port", ""+smtpPort);
             Session session = Session.getDefaultInstance(props, null);
             // Construct the message
             Message msg = new MimeMessage(session);
             msg.setFrom(new InternetAddress(from));
             msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
             msg.setSubject(subject);
             msg.setText(content);
             // Send the message
             Transport.send(msg);
             RequestDispatcher rd = request.getRequestDispatcher("another.jsp");
            try {
              rd.forward(request, response);
            catch (IOException ex) {
            catch (ServletException ex) {
public static void main(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, Exception {
    String fromemail = request.getParameter("fromemail");
    String subject = request.getParameter("subject");
    String suggestions = request.getParameter("suggestions");
    FeedbackBean bean = new FeedbackBean();
    bean.setSubject(subject);
    bean.setFromEmail(fromemail);
    bean.setSuggestions(suggestions);
    send(request, response, "smtp.host", smtp.port,bean.getFromEmail(), "[email protected]", bean.getSubject(), bean.getSuggestions());
  //Clean up resources
  public void destroy() {
}

Is it totally necessary for this kind of scenario that my servlet contain
doget and dopost methods?Yes.
Those are the methods that the server will call to invoke your servlet.
Also your methods should not be static. It needs to create an instance of the servlet to invoke it.
You could easily implement your doGet/doPost methods by just calling main(request, response) from them.

Similar Messages

  • Maintain session when calling servlet from form in a JSP

    I have the following set up:
    index.jsp calls login servlet from the action tag in a form.
    Login servlet handles the login, stores the user info and db connection in the session and uses forward(req,res) to call another jsp.
    That jsp has a form where user enters search info and in that form's action tag there is a search servlet. In the search servlet I am unable to access the session.
    Is there any way to pass the session to the servlet from that jsp using a form/action?

    I've read elsewhere that if you go from a jsp to a servlet that the >request object is cleared of any attributes from the previous request.which is correct. But arent we speaking about session object here? A request object is valid for a request - ie the phase from where the server receieves a hit for a resource upto the point it sends the output for that request.
    A session spans multiple requests.
    it doesn't retrieve the session info and gives me a null pointer >exception when I try to use the connection object stored in the session.Bad bad bad . Why do you store Connection objects in session? Create them when necessary or use a connection pool. Do you for example clean up the connections when the session expires. What if its a 30 minute session and the user hits every say 15 minutes with a request. Why do you need to hold on to the Connection in the intervening interval when the user's session is inactive?
    gives me a null pointer exception when I try to use the connection object stored in the session.which means that the Connection object is null - not the session object.
    That last line is where I get the null pointer exception. And that is
    Statement stmt = con.createStatement();?
    Same answer as above.
    If the session object was null,
    userSession.getAttribute("connection");would have thrown a NPE.
    ram.

  • JSP/Servlet form processing problem - please help

    I'm using the apache.commons.fileupload library to process a form that will ultimately insert an image into an Oracle database. At the moment, I'm not even at the database stage although I have code to do it. I'm just trying to validate that all the form fields are filled out. A JSP page posts a form to a Servlet which then checks that each field contains something. If the field is null/empty, then I use a RequestDispatcher object to forward back to the JSP with the form on it.
    Here is the problem... If I intentionally leave the form empty then the Servlet does indeed send the user back to the JSP. However, if I then complete all fields in the form after being returned to the JSP and submit the form, I am forwarded back to the JSP rather than executing the next statement in the Servlet. It's as though once I have filled out the form the null entries are being retained and the new entries are being ignored.
    Can anyone help? Perhaps I am not understanding the request/response model properly as I am used to PHP programming?

    Can you double check? Suppose you just go to the JSP. Fill in all the fields as you did before. Submit the form. Does it go to the next statement in the servlet?

  • JSP.Servlets ....

    I am working on a application where I have JVM on Power PC hardware with Linux as OS. I have also configured Apache and Tomcat and everything is running fine. I can execute example servlets as well jsp pages.
    My objective is to have java lib or jsp servlet (something) which will read /write data from Power PC and then pass it on to Host (Windows Application as well the web application
    Question: how does my Host app written in VB NET or C# will retrieve this data form Power PC? The reason I want this way as i do not want to write Power PC data read/write code twice , one for website which will run on my Power PC and then second host applciation running on windows.
    I hope I am making my point clear., any help or suggestion appriciated
    Thanks
    AGDT.

    I am working on a application where I have JVM on
    Power PC hardware with Linux as OS. I have also
    configured Apache and Tomcat and everything is
    running fine. I can execute example servlets as well
    jsp pages.Very good.
    My objective is to have java lib or jsp servlet
    (something) which will read /write data from Power PC
    and then pass it on to Host (Windows Application as
    well the web applicationJava JVM running on Power PC or Windows can read or write data for that OS without a problem.
    Web apps accept HTTP requests. HTTP protocol is the same for both Windows and PowerPC. What does the web app have to do with this?
    Question: how does my Host app written in VB NET or
    C# will retrieve this data form Power PC? Now I'm confused: Which is the host, which is the client, and where are the servlets and JSPs in all this mess?
    The reason
    I want this way as i do not want to write Power PC
    data read/write code twice , one for website which
    will run on my Power PC and then second host
    applciation running on windows.What is the Windows host? Is it also an HTTP listener that you want the servlet to connect to and send data via HTTP?
    I hope I am making my point clear., any help or
    suggestion appriciated
    Thanks
    AGDT.Clear as mud to me. Perhaps you can explain it a little better, or someone else smarter than me will see what you're driving at.
    %

  • Using JSP/Servlet to write Word Document to BLOB

    Hi
    I need some help pls
    When I use a normal class with a main method, it loads the word document into a blob and I can read this 100%.Stunning.
    With a JSP/Servlet I cannot get the document out again. The "format" seems to be lost.
    Any ideas,help greatly appreciated:
    Here is the Main class that works:
    package mypackage1;
    import java.io.OutputStream;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileReader;
    import java.io.FileNotFoundException;
    import java.io.Writer;
    import java.sql.Connection;
    import oracle.jdbc.*;
    import oracle.jdbc.OracleResultSet;
    import oracle.sql.BLOB;
    import org.apache.log4j.Logger;
    import Util_Connect.DataBase;
    public class TestLOB
    //static final Logger logger = Logger.getLogger("test");
    public TestLOB()
    public static void main(String args[])
    TestLOB testLOB = new TestLOB();
    testLOB.TestLOBInsert("c:\\my_data\\callcenterpilot.doc");
    public void TestLOBInsert(String fileName)
    Connection conn = getConnection("wizard");
    BLOB blob = null;
    try
    conn.setAutoCommit(false);
    String cmd = "SELECT * FROM so_cs.testlob WHERE docno = 1 FOR UPDATE";
    PreparedStatement pstmt = conn.prepareStatement(cmd);
    ResultSet rset = pstmt.executeQuery(cmd);
    rset.next();
    blob = ((OracleResultSet)rset).getBLOB(2);
    File binaryFile = new File(fileName);
    System.out.println("Document length = " + binaryFile.length());
    FileInputStream instream = new FileInputStream(binaryFile);
    OutputStream outstream = blob.getBinaryOutputStream();
    int size = blob.getBufferSize();
    byte[] buffer = new byte[size];
    int length = -1;
    while ((length = instream.read(buffer)) != -1)
    outstream.write(buffer, 0, length);
    instream.close();
    outstream.close();
    conn.commit();
    closeConnection(conn);
    catch (Exception ex)
    System.out.println("Error =- > "+ex.toString());
    private Connection getConnection(String dataBase)
    Connection conn = null;
    try
    DriverManager.registerDriver(new OracleDriver());
    conn = DriverManager.getConnection("jdbc:oracle:thin:@oraclu5:1600:dwz110","so_cs","so_cs");
    catch (Exception ex)
    System.out.println("Error getting conn"+ex.toString());
    return conn;
    private void closeConnection(Connection conn)
    if (conn != null)
    try
    conn.close();
    catch (Exception se)
    System.out.println("Error closing connection in get last imei"+se.toString());
    Works fine:
    Here is the display servlet: Works when main class inserts file
    package mypackage1;
    import java.io.InputStream;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileReader;
    import java.io.FileNotFoundException;
    import java.io.Writer;
    import java.sql.Connection;
    import oracle.jdbc.*;
    import oracle.jdbc.OracleResultSet;
    import oracle.sql.BLOB;
    import org.apache.log4j.Logger;
    import Util_Connect.DataBase;
    public class DisplayLOB extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    static final Logger logger = Logger.getLogger(DisplayLOB.class);
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    //response.setContentType(CONTENT_TYPE);
    //PrintWriter out = response.getWriter();
    Connection conn = null;
    PreparedStatement pstmt = null;
    try
    conn = getConnection("wizard");
    //out.println("<html>");
    //out.println("<head><title>DisplayLOB</title></head>");
    //out.println("<body>");
    //out.println("<p>The servlet has received a POST. This is the reply.</p>");
    InputStream is=null;
    oracle.sql.BLOB blob=null;
    response.setContentType("application/msword");
    //response.setContentType("audio/mpeg");
    OutputStream os = response.getOutputStream();
    String term = "1";
    String query = "SELECT docdetail FROM testlob WHERE docno = 1";
    pstmt = conn.prepareStatement(query);
    ResultSet rs = pstmt.executeQuery();
    while (rs.next())
    blob=((OracleResultSet)rs).getBLOB(1);
    is=blob.getBinaryStream();
    int pos=0;
    int length=0;
    byte[] b = new byte[blob.getChunkSize()];
    while((length=is.read(b))!= -1)
    pos+=length;
    os.write(b);
    }//try
    catch (Exception se)
    se.printStackTrace();
    finally
    try
    pstmt.close();
    catch (Exception ex)
    System.out.println("Error closing pstmt "+ex.toString());
    //out.println("</body></html>");
    //out.close();
    private Connection getConnection(String dataBase)
    Connection conn = null;
    try
    conn = DataBase.getPoolConnection(dataBase);
    catch (Exception se)
    logger.fatal("Error getting connection: ",se);
    return conn;
    private void closeConnection(Connection conn)
    if (conn != null)
    try
    conn.close();
    catch (Exception se)
    logger.error("Error closing connection in get last imei",se);
    Here is JSP/Servlet
    <%@ page import="org.apache.log4j.*"%>
    <%@ page contentType="text/html; charset=ISO-8859-1" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>untitled</title>
    <title>Wizard SMS Interface</title>
    <link rel='stylesheet' type='text/css' href='main1.css'>
    <script language='JavaScript' src='copyright.js'></script>
    </head>
    <pre>
    <%
    //HTTP 1.1
    response.setHeader("Cache-Control","no-cache");
    //HTTP 1.0
    response.setHeader("Pragma","no-cache");
    //prevents caching at the proxy server
    response.setDateHeader ("Expires", 0);
    Logger logger = Logger.getLogger("co.za.mtn.wizard.administration.admin01.jsp");
    %>
    </pre>
    <body>
    <FORM ACTION="/WizardAdministration/uploadfile"
    METHOD="POST"
    ENCTYPE="multipart/form-data">
    <INPUT TYPE="FILE" NAME="example">
    <INPUT TYPE="SUBMIT" NAME="button" VALUE="Upload">
    </FORM>
    </body>
    </html>
    <font> <b>Copyright &copy;
    <script>
    var LMDate = new Date( document.lastModified );
    year = LMDate.getYear();
    document.write(display(year));
    </script>
    Mobile Telephone Networks.
    <p align="left"><i><b><font face="Georgia, Times New Roman, Times, serif" size="1"></font></b></i></p>
    package co.za.mtn.wizard.admin;
    import java.io.InputStream;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileReader;
    import java.io.FileNotFoundException;
    import java.io.Writer;
    import java.sql.Connection;
    import oracle.jdbc.OracleResultSet;
    import oracle.sql.BLOB;
    import org.apache.log4j.Logger;
    import Util_Connect.DataBase;
    public class UploadFile extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    //static final Logger logger = Logger.getLogger(UploadFile.class);
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    String headerName = null;
    Enumeration en = request.getHeaderNames();
    try
    while ( en.hasMoreElements() )
    Object ob = en.nextElement();
    headerName = ob.toString();
    System.out.println("Value for headerNAme is >"+headerName+"<");
    String aaa = request.getHeader(headerName);
    System.out.println("Value for aa is >"+aaa+"<");
    catch (Exception ex)
    System.out.println("Error in extracting request headers"+ex.toString());
    Connection conn = getConnection("wizard");
    BLOB blob = null;
    try
    conn.setAutoCommit(false);
    String cmd = "SELECT * FROM so_cs.testlob WHERE docno = 1 FOR UPDATE";
    PreparedStatement pstmt = conn.prepareStatement(cmd);
    ResultSet rset = pstmt.executeQuery(cmd);
    rset.next();
    blob = ((OracleResultSet)rset).getBLOB(2);
    //File binaryFile = new File("h:\\callcenterpilot.doc");
    //System.out.println("Document length = " + binaryFile.length());
    //FileInputStream instream = new FileInputStream(binaryFile);
    response.setHeader("Content-Type","application/vnd.ms-word");
    String contentType = request.getContentType();
    System.out.println("Content type received in servlet is >"+contentType+"<");
    ServletInputStream instream = request.getInputStream();
    OutputStream outstream = blob.getBinaryOutputStream();
    int size = blob.getBufferSize();
    byte[] buffer = new byte[size];
    int length = -1;
    while ((length = instream.read(buffer)) != -1)
    outstream.write(buffer, 0, length);
    instream.close();
    outstream.close();
    conn.commit();
    closeConnection(conn);
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    catch (Exception ex)
    System.out.println("Error =- > "+ex.toString());
    //out.println("</body></html>");
    //out.close();
    private Connection getConnection(String dataBase)
    Connection conn = null;
    try
    conn = DataBase.getPoolConnection(dataBase);
    catch (Exception se)
    System.err.println("Error getting connection: "+se.toString());
    return conn;
    private void closeConnection(Connection conn)
    if (conn != null)
    try
    conn.close();
    catch (Exception se)
    System.err.println("Error closing connection in get last imei"+se.toString());
    This is what the display servlet is showing when the JSP/Servlet insert the document
    -----------------------------7d31422224030e
    Content-Disposition: form-data; name="example"; filename="H:\(your name) Skills Matrix.doc"
    Content-Type: application/msword
    �� ࡱ � > ��     � � ���� � � ���������������������
    Tks
    Andre

    hello,
    there are multiple documents out there, describing the oracle reports server setup. try doc.oracle.com for documentation.
    also it is part of the online-documentation.
    you need to install 9iAS enterprise edition. the server is pre-configured and will listen to the url http://yourserver/dev60cgi/rwcgi60.exe
    passing only this url you will get a help-screen, describing the syntax.
    regards,
    the oracle reports team

  • How to implement this function in JSP/Servlet env?

    Hi all,
    I working on a project, it provides functionality to upload file using JSP/Servlet. In the first JSP page, there is file location and submit button. After user select a file to upload and click submit button, a message, like "sending file to XXXX", will be shown on the screen. Once uploading and validation are done on the server-side, a successful/error msg will be shown to user.
    Here I have a question for the "sending..." msg and the successful/error msg. They should be put in one jsp page or in two separate page? how to implement them?
    Thanks for any help!
    Tranquil

    For the sending message... Well, the thing is, when you click submit, it's sending the file to the server and the server is processing it, and this is all done before the "complete" page is sent to the server. So one would need to use some Javascript on the page before the actual submit happens to show some message. This is done on Ebay when you put something for sale, you can upload an image, and there is a little popup message telling you that it's uploading, and it is removed when the process is done. Now, I'm not sure the exact details of how this works, but my educated guess is this:
    1) The onsubmit function of the form checks that the file upload fields have a value (no need to popup a message if no file upload, since that's what usually takes the time, although it could just be assumed there is a file). If a file is to be uploaded, or just want to show the message anyway, a new popup window is opened with the window.open method and the "sending" message is shown (either written via Javascript or just load a small web page to the window).
    2) The popup window, since you can't transfer the window object from the form page to the next page, has to check window.opener for some value that the success/error page would have to set. The success/error page could use it's body onload function to set a variable in it's own window object to denote that the page is loaded. The popup window can use a looping check using setTimeout or setInterval in Javascript to check for window.opener.isLoadedVariable to be present, and if so, close itself.
    I've never done that, but I see no reason why it wouldn't work.

  • Jsp / Servlet / bean / upload

    Hello,
    I use a jsp to enter several fields. These fields are sent to a servlet by using a bean (recorded in the current session). Until now there is no problem. The servlet receives all information. Now I must also send 5 files which must be stored on the server. I have thus to add in my jsp 5 file fields.
    My question :
    Is it possible to integrate the FileUpload package for uploader my files without anything to change in my code (by using of a bean to exchange the data between my jsp and my servlet). ??
    In other words, it is possible to use my bean to also transport files. ??
    Tank u for u help

    Yes it is possible..
    download cos.jar from www.oreily.com for file upload..
    it will read dat from the form as two parts ..
    parameter part and file part..
    and you can implement it throgh a servlet easily..
    for more follow oreily JSP/servlets Cookbook

  • JSP- Servlet-- Bean-- JSP how to implement

    I have problem.
    My JSP will take a emplyee id .
    Now I want to show all the values regarding that employee in a JSP(JSP form) from the DB(Oracle).
    So Iam planning like
    JSP-->Servlet-->Bean-->JSP
    So my doubts are.
    1. Is it correct approach
    2.If it is correct then which part of the flow connects to DB and stores the value before putting to JSP.
    Iam using Tomcat 4.31
    Plz help me

    I have problem.
    My JSP will take a emplyee id .
    Now I want to show all the values regarding that
    employee in a JSP(JSP form) from the DB(Oracle).
    So Iam planning like
    JSP-->Servlet-->Bean-->JSP
    So my doubts are.
    1. Is it correct approach
    2.If it is correct then which part of the flow
    connects to DB and stores the value before putting to
    JSP.
    Iam using Tomcat 4.31
    Plz help meHI
    What you are probably proposing is an MVC design pattern. I wonder if u have heard of the struts framework. Sruts uses MVC design pattern wherein the servlet u are talking about acts as a controller(C) and the bean acts as the model(M) .The JSPs present the view(V). Hence the name MVC.
    Your approach is right. First get the employee ID from the jsp and get the corresponding data from database(This logic u implement in the servlet). Then save the fetched data in a bean so that the result jsp can fetch data from it.
    Now this is not a strict MVC approach.
    Learn more about struts. It presents a much more cleaner solution.

  • Can somebody explain to me how JSP, servlets, ASP work within Sun's server

    Ok, I'm only beginning to get a grip of how all this works. And I have a lot of questions and confusion.
    1.) The server that comes with J2EE, what is that server? Is it an app server that runs only servlets and JSP, with some Web server stuff so it can output some info? Is it a stripped down version of TomCat? I am having a lot of trouble with the J2EE server (the one that comes with the SDK), and that is why I'm asking, maybe I don't need it. But I really want to learn JSP's, JScripts, and Beans. How else can I go about doing that, other than all out Tomcat.
    2.) Also can I run Servlets on Microsft's IIS on a Windows 2000 machine? Do I need a special API to run servlets, or JSPs?
    So how I see it, and again, I am a newbie at this. Machines that host a website, above all needs a web server. let's say most people use Apache, and they want to run it in Linux, becuase they want to be hackers. So then do they also run Tomcat, or IIS, or Coldfusion, or a million other servers in tandem on the same machine, so that they can handle ASP, JSPs, servlets, .cmf, etc.? or do they separate the app server from the webserver and then do some sort of linking? if somebody can direct me to how all this stuff works, I would greatly greatly appreciate it.

    Sounds like you need to read the J2EE spec as well as
    the servlet and JSP specs. It helps to glance through
    sections you are interested in.
    Ok, I'm only beginning to get a grip of how all this
    works. And I have a lot of questions and confusion.
    I think for a newbie, deploying your jsp's and servlets
    to a J2EE compliant app server can be quite a headache.
    You might want to concentrate on tomcat, which does servlet
    and jsp.
    Some app servers provide a http connector for most common web servers.
    I think tomcat has a IIS connector. In this case IIS would serve static html as well as its own stuff, other things like servlets and jsp go to tomcat. I am unsure about this as I mostly use tomcat in standalone mode. You can run tomcat on windows, as it is written in java.
    >
    2.) Also can I run Servlets on Microsft's IIS on a
    Windows 2000 machine? Do I need a special API to run
    servlets, or JSPs?

  • Feedback form link broken

    The Release notes for the Sun App. Server 8, update 1 features several broken links (including that to the Bug Feedback form)
    The links are contained here: http://docs.sun.com/source/817-7422/releasenotes.html#wp1024635
    The broken links are:
    http://java.sun.com/docs/forms/J2EE14SubmittalForm.html
    http://archives.java.sun.com/archives/j2ee-interest.html
    http://developer.java.sun.com/servlet/SessionServlet?url=/developer/bugParade/index.jshtml

    Thanks for the heads up, looks like all three links on the relese notes page are broken. While the links are broken the text that represents the links are correct. Just click on the links in your message and you'll go where you want to go.
    Thanks again.

  • Feedback form working!

    I have at last got my feedback form working in a reasonably
    presentable manner.
    If you would like to test it, go to
    http://localhost/Corybas/index.php,
    click
    the yellow envelope at the bottom right of the home page, and
    send me a message.
    When I get the site converted to php, this envelope will
    appear on every page.
    Eventually I want to get the 'Thank you' form on a separate
    page. At present I
    am using the same page as the feedback form, and because of
    the way my templates
    are designed the page footer is in another table which is
    drawn after the
    'Contents' table, so on the Thank you page it is not drawn,
    and there is no way
    I can draw it using the standard template.
    I discovered that if I use JavaScript to launch the feedback
    page, not only can
    I close it again without IE querying it, but ZoneAlarm does
    not regard it as a
    pop-up, and does not block the feedback envelope.
    Clancy

    Clancy:
    I can't help thinking you are still confused with all of
    this. Why is the
    ZA thing bothering you anyhow? It would only be an issue for
    *you* testing
    locally....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Clancy" <[email protected]> wrote in message
    news:[email protected]..
    >I have at last got my feedback form working in a
    reasonably presentable
    >manner.
    > If you would like to test it, go to
    http://localhost/Corybas/index.php,
    > click
    > the yellow envelope at the bottom right of the home
    page, and send me a
    > message.
    > When I get the site converted to php, this envelope will
    appear on every
    > page.
    >
    > Eventually I want to get the 'Thank you' form on a
    separate page. At
    > present I
    > am using the same page as the feedback form, and because
    of the way my
    > templates
    > are designed the page footer is in another table which
    is drawn after the
    > 'Contents' table, so on the Thank you page it is not
    drawn, and there is
    > no way
    > I can draw it using the standard template.
    >
    > I discovered that if I use JavaScript to launch the
    feedback page, not
    > only can
    > I close it again without IE querying it, but ZoneAlarm
    does not regard it
    > as a
    > pop-up, and does not block the feedback envelope.
    >
    > Clancy

  • Sample jsp servlet bean (MVC) code

    We want to look into the JSP/Servlet/Bean area for our next project. We wish to understand the technology and as such want to hand build simple applications, and as such do not want to use JDeveloper just yet.
    We have searched and searched for suitable material but cannot anywhere find a sample application that :
    A. Lists contents of a databse table
    B. Each item in trhe list is a link to a page that allows that item, to be edited.
    C. A new item can be added.
    D. Uses the MVC model of JSP/Servlet and bean (preferably with no custom tags)
    There are examples that are too simplistic and do not cover the whole picture. Having spent over 100 GBP on books lately, only to be disappointed with the examples provided, we need to see some sample code.
    The samples provided by Oracle are too simplistic. They should really have provided ones built around the EMP and DEPT tables.
    Anyone know where we can get hold of this sample code.

    At the risk of sounding really dumb the examples are just too complex. There does not appear to be anywhere on the web where I can find a simple JSP/servlet/bean example of the type I described. There is enouigh material describing each individual component, but what I need is an example to cement the ideas, but the ones suggested are too much for a newbie. Even the much vaunted Pet Store thingy causes my eyes to glaze over.
    I dont expect anyone to have written something with my exact requirements, but surely to goodness there must be something that:
    1. On entry presents a search form on a table (e.g. EMP)
    2. On submission list all rows in EMp matchiung the criteria.
    3. The user can either click the link 'Edit' which opens up a form dispalying the row allowing the user to edit and save the changes, or click the 'New' button to show a blank form to create a new EMP.
    All this via a Controller servlet, with the database logic handled by a java bean, and all the presentation done via JSP.
    To me this is the most obvious and instructive example of this technology, but after days of trawling the web, and looking through a number of books, I cannot find such a thing.
    CGI with Perl DBI/DBD was a breeze to work with compared to this stuff ..... maybe ASP with SQL/Server would be a more fruitful use of time.

  • Email feedback form in Portal

    Hi guys, very simple question here for some of you i would imagine. I have just started to maintain our company intranet - which is built with Portal9iAS - and as such i am a bit clueless at the moment.
    What i need is an email feedback form on the intranet that staff can fill in then submit, and the results can be emailed back to me and stored in the db. How can i achieve this in the simplest possible way?
    I know a bit of Java, but don't know how to use a JSP page to achieve this.
    Regards,
    Paul

    Create the table to hold your data.
    Create a Portal Form component based on that table. Give priviledges to the users (maybe authenticated_users?).
    Create a database trigger on that table, on insert, that uses the UTL_SMTP PL/SQL package to send the email.
    Google/Metalink UTL_SMTP for code examples.

  • Menu item in Jsp/Servlet

    Hi experts, when you're using Jsp/Servlet to implement the front-end web application, what options do you have for implementing some menu dropdown?
    Is awt or swing can be used for that purpose?
    How would you go about the layout management issue?
    Thanks, and your reponse is appreciated

    I guess You are looking for a solution in JSP/Servlets. Here is my program that might be help ful to you. This program will bring a drop down list that fetches the values from the database.
    <table cellpadding=4 cellspacing=2 border=0 align=center>
    <TR>
    <TD><B>choose Code</B></TD>
    <TD valign=top>
    <!-- this code is to generate the list of Codes-->
    <% String userId =(String) session.getValue("userName"); %>
    <%
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    String uId;
    String returnString="";
    String null_value="";
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection("jdbc:oracle:thin:@serverName:1521:localHost", "scott", "tiger");
    if (con == null) {
    System.out.println("Connection not found");
    stmt = con.createStatement();
    con.setAutoCommit(false);
    String sql= "select code from example_list where user_id='"+userId+"'";
    rs= stmt.executeQuery(sql);
    %>
    <select name="alcList">
    <%String aString;
    rs= stmt.executeQuery(sql);
    while (rs.next()) {
    %>
    <option value="<%= aString = rs.getString("code") %>">
    <%= aString %></option> <%}%></select><%
    con.commit();
    //returnString= true;
    } catch(SQLException sqlex) {
    sqlex.printStackTrace();
    //return returnString;
    } catch(Exception ex) {
    ex.printStackTrace();
    } finally {
    stmt.close();
    con.close();
    stmt = null;
    rs = null;
    con = null;
    %></TD>
    <TD align=center>
    <INPUT TYPE=submit SIZE=30 VALUE="Submit"></TD>
    </TR>
    </Table>
    </FORM>
    </BODY>
    </HTML>if this doesn't answer your problem, Please post your question exactly. May be I can help you out.
    Good Luck.
    -Sreekanth varidhireddy

  • Run servlet from form action tag

    This is my first post to this forum, thanks in advance for any and all help!
    I'm utilizing Tomcat 4.0.1. I've got the following form tag within my JSP:
    <form name="orderForm" method="GET" action="/myAppName/myServletName">
    I've made the context entry for myAppName within ..tomcat/conf/server.xml.
    I've got a properly formatted ..tomcat/webapps/myAppName/web-inf/web.xml
    When submitting the form, Tomcat immediately reports that the resource (myServletName) is unavailable.
    I've download the bookstore sample app from Sun; it is working properly.
    Any idea what I'm missing here?
    The bookstore app calls the servlet from a hyperlink rather that a form action. Do JSP's treat forms differently when calling servlets?
    Thanks again for any assistance.
    Bruce

    Yes, my .class files in in Tomcathome/webapps/appname/web-inf/classes
    If I try and call the servlet from the Address box of the browser, I get the same error listed above.
    Here is the contents of my Tomcathome/webapps/appname/web-inf/web.xml:
    <-- entry begins here
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
         <servlet>
              <servlet-name>myServletName</servlet-name>
              <servlet-class>myServletName</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>myServletName</servlet-name>
              <url-pattern>/myServletName</url-pattern>
         </servlet-mapping>
    </web-app>
    < -- entry ends here
    Here is the entry I've made in Tomcathome/conf/server.xml:
    <--entry begins here
    <Context path="/appName" docBase="appName" debug="0" reloadable="true" />
    <--entry ends here
    The only Tomcat related entry in my classpath is:
    d:\jakarta-tomcat-4.0.1\common\lib\servlet.jar;
    Again, thanks for all your assistance...this is driving me nuts (granted, it wasn't a long trip!)
    Bruce

Maybe you are looking for