Send XML through JSP pages

Hi friends
I was wondering if it's possible to send XML data when a form button is pressed. Suppose we have in the client machine a browser displaying a HTML Form with one text inputtype and one button to send this information to the JSP Server. If the inputtype's name is 'user' it's easy to retrieve this information in the JSP component, just a request.getParameter("user") would work fine. But I want to send the text of the inputtype through XML. Something like :
<data>
<user>
smith
</user>
</data>
How could I tell the browser to send the information through XML ? Is it possible ? And how could I retrieve this XML data in the JSP component ?
Thanks a lot

What I have done is working with 'bare hands', I'll paste my simple code here:
This is my HTML page for colleting the info:
<html>
<head>
<title>Envio de XML</title>
</head>
<body>
<form action=http://remoteaddress:8080/Proyecto/xmlsend method=POST>
<BR>
<BR>Numero Movil
<input type=text name=numero>
<p>
<BR>Operadora
<input type=text name=operadora>
<p>
<BR>Mensaje
<input type=text name=mensaje>
<p>
<input type=submit value=Aceptar><input type=reset value=Limpiar>
</form>
</body>
</html>
And here it's my servlet code to process and convert it to XML:
import java.io.*;
public class xmlsender extends HttpServlet
public void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
ServletOutputStream salida = res.getOutputStream();
res.setContentType("text/xml");
String cadenanumero = req.getParameter("numero");
String cadenaoperadora = req.getParameter("operadora");
String cadenabody = req.getParameter("mensaje");
salida.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
salida.println("<mensaje id=\"000001\" tipo=\"SMS\" fecha=\"2004-04-26T10:54:33\">");
salida.println("<numero>" + cadenanumero + "</numero>");
salida.println("<operadora>" + cadenaoperadora + "</operadora>");
salida.println("<body>" + cadenabody + "</body>");
salida.println("</mensaje>");
Don't know if this is what you want, but maybe it can at least illustrate you, I hope so.

Similar Messages

  • Not able to compile an xml file using jasper reports through jsp page

    hi,
    i have compiled an xml file and got html,pdf etc using jasperreports but that was from an java application and now i want to convert this application to an jsp page so i have copied these jar files "commons-beanutils-1.5.jar","commons-collections-2.1.jar","commons-digester-1.3.jar","itext-1.01.jar","jasperreports-0.5.2.jar" to the folder "C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\lib" and have set classpath to these jar files.
    my application(java class invoked by a servlet) is in C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes.
    i m using this API "JasperCompileManager.compileReportToFile(fileName);"
    but i m getting following error:
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Invoker service() exception
         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:504)
         at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2312)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
         at org.apache.commons.digester.Digester.(Digester.java:345)
         at dori.jasper.engine.xml.JRXmlDigester.(JRXmlDigester.java:115)
         at dori.jasper.engine.xml.JRXmlLoader.prepareDigester(JRXmlLoader.java:446)
         at dori.jasper.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:384)
         at dori.jasper.engine.xml.JRXmlLoader.load(JRXmlLoader.java:371)
         at dori.jasper.engine.xml.JRXmlLoader.load(JRXmlLoader.java:339)
         at dori.jasper.engine.xml.JRXmlLoader.load(JRXmlLoader.java:323)
         at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:102)
         at jasper_interact.file_exporter(jasper_interact.java:44)
         at reportcontroller.doGet(reportcontroller.java:59)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:446)
         at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2312)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
         at java.lang.Thread.run(Thread.java:536)
    i have one folder "C:\Program Files\Apache Tomcat 4.0\org\apache\commons\logging" containing some LogFactory calsses but i dont know where to put this folder so that tomcat can find them.
    please help me..
    i know i may not be clear to u but plz give me some way out i m totally stucked.
    manish

    hi,
    thanx for your reply.
    ya i have "commons-logging-1.0.2.jar" file but when i tried to put it with other jar files and set the class path and run the application thru tomcat then it automatically stops the tomact.and when i removed this perticular logging jar file then tomcat works normally but gives the error which i mentioned before.
    i have also tried the second option u suggested, by putting the LogFactory class files in "C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes\org\apache\commons\logging" but that was not working.shud i set some classpath for them? or shud i have to import these packages........ but when i copied this folder "org" to C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes and in program wrote import org.* then copilation error occured "no such package found.
    what to do now.
    manish

  • Send message from JSP page to Java message driven bean

    Hi all
    I'm using Jdev903.
    I need to send a message from JSP page (Web Application) to Java Message Driven Bean.
    * I created Message Driven Bean that named: MyMessageDrivenEJBBean
    * I have configed jms.xml:
    <topic-connection-factory name="ChatTopicConnectionFactory" location="jms/theTopicConnectionFactory"/>
    <topic name="ChatTopic" location="jms/theTopic"/>
    * In JSP page, my code is:
    final Context ctx = new InitialContext();
    // 1: Lookup ConnectionFactory via JNDI
    TopicConnectionFactory factory =(TopicConnectionFactory)ctx.lookup("jms/theTopicConnectionFactory");
    But trouble occurs is:
    javax.naming.NameNotFoundException: jms/theTopicConnectionFactory not found
    please help me!
    thank a lot.

    Welcome to the Sun forums.
    1. Please post your code using code tags, this formats it so that it is easier for people to read and understand it. Click on 'CODE' above the text area when posting.
    2. As far as possible, please post an SSCCE
    What have learnt about JSPs and servlets till now? Because reading the values submitted in a form is pretty much the base of all operations. I suggest you Google for [servlet tutorials|http://www.google.com/search?q=servlet+tutorial] and [JSP tutorials|http://www.google.com/search?q=jsp+tutorial] and go through them thoroughly. After you understand what is to be done and what options are available to you, if you still face problems, please feel free to post your queries here. But this isn't exactly a site for tutorials, especially since there are so many good ones already out there, that explain all this stuff in detail. There's no point in re-inventing the wheel.
    Hints: [ServletRequest#getParameter()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)] and [RequestDispatcher#forward|http://java.sun.com/javaee/5/docs/api/javax/servlet/RequestDispatcher.html]

  • How to send email through jsp

    can anyone please help me ...
    how do we send an email from a jsp page to any gmail,hotmail,yahoomail etc....
    what is the code for that
    if anybody know the solution it will be greatly appreciated ..
    regards
    santhosh
    9341208148

    I have a writeup that shows how to use JavaMail. It presents my EmailDelivery class (and example of how to use it) which I wrote to help me easily send emails from my Java applications using JavaMail. It supports relaying through SMTP servers that require authentication and has convenience methods for easily adding file attachments.
    Check it out at:
    http://timarcher.com/?q=node/53

  • How to send info from JSP page as email-body

    Hi,
    i have a JSP page that generates dynamically as a result of some query. I have a Button - "Send Email".
    I want to send the information to the receipient thru email automatically on a button click,
    All information is in the memory. How can we pick the info from memory and send it as a message thru email?
    Pls help.
    thanx & regards,
    Shalini

    create a servlet to send mail (use the JavaMail api) then Post the message to the servlet when you click on the button.
    OR, put the message and any other data (like the email address) into the session, and then just call the servlet on click of the button, and have the servlet retrieve the information from the session.

  • Send mail from JSP page

    Hello,
    can some one help me to send emails from a jsp page.
    and if possible the source code of jsp or java...
    Thanks !

    read this:
    http://www.jspinsider.com/tutorials/jsp/javamail/jspjavamail_1.view

  • Sending mail from JSP page

    HI Everyone,
    Please help me out in this. It is very urgent so not able search the same in this forum.
    I have a J2EE application. The view is in JSP. If i click a button from a JSP page, any mail client (Microsoft Outlook) has to open and current page need to be attached as html. THen user wish to send the mail to somebody...
    So my aim is to open a outlook and attache the current JSP page as html. PLease help me out !

    Instead of outlook, you can do it easily using SMTP

  • Sending mail from JSP page with attachment

    I have a requirement to send mail with attachment from my jsp pages, which should come to a particular mail box. Can any one help me by sending sample codes. Thankx in advance.

    hi,
    When request is posted you have to save file data from request to a file. you can not access the data using request.getParameter("file").

  • How to open pdf files in FireFox through jsp page?

    hi all,
    i have a problem when i click the link in jsp page. whenever i am clicking the jsp page link it wants to open a pdf file, the pdf file is located in remote system. its working properly in Internet Explorer. but i am opning this in FireFox means its not opening. In firefox url that is not showing the exact path. optionally its showing like that:
    http://172.16.2.21:9090/FMS/source/
    journal/%5C%5C172.16.2.1%5C
    copyediting%5CELS%5C
    Manuscript_Screening%5CMS%5C
    RDTEST%5C02-Process%5C
    RDTEST-D-08-02051.fdf
    and my jsp code whichever working fine in Internet Explorer is :
    <%
    String newpath="\\\\172.16.2.1\\copyediting
    \\ELS
    \\Manuscript_Screening\\MS\\RDTEST\\
    02-Process\\RDTEST-D-08-02051.fdf";
    %>
    <a href="<%=newpath%>" target="dynamic"></a>can any one solve my problem. as soon as possible. thanks in advance.

    hi Edmondo ,
    This is html generated jsp compilation code.
    link1
    can u please give me the solution. thanks in advance......

  • Not able to connect to database through JSP page

    Hello Everyone,
    I'm creating a simple JSP page (helloworld.jsp) that would get info from the db and display it but when I point my browser to http://localhost:8080/helloworld.jsp, I get ClassNotFound exception.
    <html>
    <head>
    <title>My first JSP page
    </title>
    </head>
    <body>
    <%@page import="java.sql.*" %>
    <%
         try{
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         String url = "jdbc:mysql:///" + "trylnp";
         String user = "root";
         String pass = "welcome";
         Connection conn = DriverManager.getConnection(url,user,pass); 
         out.println("here");
         if((conn != null)&&(!conn.isClosed()))
              out.println("Connected...");
         String releasenum="3.1.48A";
         String query = "Select * from releasedata where releaseno='" + releasenum + "'; ";
         Statement s = conn.createStatement();
         ResultSet rs = s.executeQuery(query);
         while(rs.next())
              String useraction = rs.getString("useraction");
              String releaseno = rs.getString("releaseno");
              int ninetyfivepercentile = rs.getInt("ninetyfivepercentile");
              int ninetypercentile = rs.getInt("ninetypercentile");
              int fiftypercentile = rs.getInt("fiftypercentile");
              out.println("useraction : ");
              out.println("releaseno : ");
              out.println("ninetyfivepercentile : ");
              out.println("ninetypercentile : ");
              out.println("fiftypercentile : ");                    
         catch(Exception e ){
              out.println(e);
    %>
    </body>
    </html> I've properly set my classpath to C:\Program Files\mysql-connector-java-5.1.6\mysql-connector-java-5.1.6-bin.jar
    and also put the jar file in all the WEB-INF sub folders inside C:\apache-tomcat-6.0.16\webapps (I know it had to go in one of the WEB-INF dir, but as I was not sure which one, I put the jar file in all of the WEB-INF folders)
    Please, do let me know if u know how to resolve the issue. It'll be a big help.
    Thanks.

    I've properly set my classpath to C:\Program Files\mysql-connector-java-5.1.6\mysql-connector-java-5.1.6-bin.jarI don't think that does anything. You aren't compiling a .java file.
    If you put mysql-connector-java-5.1.6-bin.jar in the directory:
    apache-tomcat-6.0.x/libit will be available to all your applications.
    After making a few changes to your code, the following worked for me:
    <html>
    <head>
    <title>My first JSP page</title>
    </head>
    <body>
    <%@page import="java.sql.*" %>
    <%
      try{
      Class.forName("com.mysql.jdbc.Driver").newInstance();
      String url = "jdbc:mysql://localhost/mydb1";
      String user = "me";
      String pass = "jsptest";
      Connection conn = DriverManager.getConnection(url,user,pass);
      out.println("<div>here</div>");
      if((conn != null)&&(!conn.isClosed()))
        out.println("<div>Connected...</div>");
      String name="diane";
      String query = "Select * from mytable2 where name='" + name + "'" ; 
      Statement s = conn.createStatement();
      ResultSet rs = s.executeQuery(query);
      while(rs.next())
        //String useraction = rs.getString("useraction");
        //String releaseno = rs.getString("releaseno");
        //int ninetyfivepercentile = rs.getInt("ninetyfivepercentile");
        //int ninetypercentile = rs.getInt("ninetypercentile");
        //int fiftypercentile = rs.getInt("fiftypercentile");
        //out.println("useraction : ");
        //out.println("releaseno : ");
        //out.println("ninetyfivepercentile : ");
        //out.println("ninetypercentile : ");
        //out.println("fiftypercentile : ");       
        int id_result = rs.getInt("id");
        String name_result = rs.getString("name");
        out.println("<div>" + id_result + " - " + name_result + "</div>");
      catch(Exception e ){
        out.println("<div>something is wrong</div>");
        out.println("<div>" + e + "</div>");
    %>
    </body>
    </html>

  • Can we call a javascript fun through jsp page without any event

    Hi ,
    I am new to jsp,javascript and i have a little question.
    If i make a function in a js file and want to call it from a jsp file without any event ,ie can i write some thing like <%abc()%> in ths jsp page ,which call the function from another .js file.
    I suppose that it can be done as gmail page reloads it self after some time and for http mostly we use pull ie request from the client side ,so i think that they must be doing something like timer expiry and reload themselves.
    please help me with the solution.
    Thanks & Regards
    Saurabh

    sorta....
    The JS runs in the client, not on the server, so you would just be writing JS code as HTML... If your page is like this and the myscript.js file defines 2 functions (function1, function2), you can call them on page load in either of these ways. I'm not sure offhand which would get called first, but the scripts called inline in the page would be called in the order they are defined in the page. But that is all HTML, it has nothing to do with JSP.
    <head>
    <script language="JavaScript" type="text/javascript" src="myscript.js" />
    </head>
    <body onload="function1();">
    <script language="JavaScript" type="text/javascript">
    function2();
    </script>
    </body>

  • Java problem -- sending email via JSP page

    Below is a copy of my feedback page
    Basically, I am doing my work in a JSP page.
    For now, my plan is that when I click on the ''submit'' button, everything written on the text boxes will be sent to my email (my hotmail address)
    However, I do not know what are the codings needed (honestly speaking, I went up to Google to search but then, the codings are complicated and I don't know what is written) and neither do I know whether should I place all codings on one JSP page or place the codings for submission to my email on another JSP page.
    Please help. Thank you.
    http://i468.photobucket.com/albums/rr43/mrclubbie/feedback_page.jpg (sorry you have to copy the link and paste on your browser)
    Edited by: mrclubbie on Jun 27, 2010 3:05 AM

    You do not have a problem, so stop trying to pretend you have one. Lack of knowledge is not a problem, because it has a very easy fix: study more. Invest some time. Seriously, you are going to find blocks at every corner until you fully understand the tools you are using, and you are not going to find the answers by posting in forums hoping for someone to bail you out.
    I find that Javaworld usually has clear and precise articles, so I would use this one as the basis for your research:
    [http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html|http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html]
    Good luck!

  • Sharing a bean information through jsp pages

    Morning,
    I want to use a java bean in two jsp pages, so is it possible to share it (to set its properties in the 1st page and retrieve them in the 2nd)?
    If not, what should I do? Could I use forward and set param?
    Here is my 1st jsp
    ==================
    <%@page language="java" %>
    <jsp:useBean id="doctorConn" scope="session" class="beans.DoctorBean" >
         <jsp:setProperty name="doctorConn" property="*" />
    </jsp:useBean>
    <%
    if(doctorConn.getUserId().equals("") ||doctorConn.getPassword().equals(""))
         response.sendRedirect("notAuthorised.jsp");
    System.out.println("user id : " + doctorConn.getUserId()+ " password : " +doctorConn.getPassword());
    if(doctorConn.isAuthorised(doctorConn.getUserId(), doctorConn.getPassword())) {
    %>
         <jsp:forward page="doctorApp.jsp" />
    <%
    else response.sendRedirect("notAuthorised.jsp");
    %>
    ==================
    my second
    =================
    <%@page language="java" %>
    <%@page import ="java.sql.*" %>
    <%@page import ="java.lang.Exception"%>
    <jsp:useBean id="doctorConn" scope="session" class="beans.DoctorBean" />
    <jsp:useBean id="appointment" scope="session" class="beans.Appointment" >
         <jsp:setProperty name="appointment" property="*" />
    </jsp:useBean>
    ...etc
    ===========================
    I am using Tomcat 4 and in the 2nd page I am getting an error about doctorConn
    Thank you,

    Yes ofcorse. You can do it in many ways.
    Firstly, declare properties of your bean as static that you want to share between pages and create new instance of bean on each page.
    Secondly you can store the same instance of the bean in you session. On th other page, you can retrive same instance of the bean whenever needed.
    Otherwise, you can create a gateway class that maitain static reference of you bean class.

  • Problem on sending sms in jsp page

    hi to all,
    i am using smslib for sending sms from pc to mobile.it work fine in all java file but when i implement in jsp file it gane me error of serial port that"port does not exist".how can i solve this problem...
    Edited by: kinjal on May 30, 2008 9:36 AM

    hi,
    this was sort of an urgent requirement, i was using J2SE, no way to compile servlets,
    when i compile sample code in SE, it gave me 6 errors
    C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\star\WEB-INF\clas
    ses\com\stardeveloper\servlets>javac -cp %CATALINA_HOME%\lib\servlet-api.jar Tes
    tServlet.java
    TestServlet.java:7: package javax.servlet does not exist
    import javax.servlet.*;
    +^+
    TestServlet.java:8: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    +^+
    TestServlet.java:10: cannot find symbol
    symbol: class HttpServlet
    +public class TestServlet extends HttpServlet {+
    +^+
    TestServlet.java:12: cannot find symbol
    symbol  : class HttpServletRequest
    location: class com.stardeveloper.servlets.TestServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    +^+
    TestServlet.java:12: cannot find symbol
    symbol  : class HttpServletResponse
    location: class com.stardeveloper.servlets.TestServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    +^+
    TestServlet.java:13: cannot find symbol
    symbol  : class ServletException
    location: class com.stardeveloper.servlets.TestServlet
    +throws IOException, ServletException {+
    +^+
    +6 errors+
    at the sametime sun site was offline, so i decided to do it in JSP,
    upto upadating DB im done,
    but get stuckd at sms part,
    now ive installed the J2EE, but stil when i compile, it gives the same old errors.
    im completely new to this area of web applications, dont hav know how of the operation.
    what i want is sending SMS using SMPP on button click in web page.
    pls pls help me get rid of this, either using servlets or JSP
    thanking u.....

  • Accessing  global controller.jpf variables through JSP pages

    Hey All
    I wish to access an XML-Bean set as an variable in my Controller.jpf
    file. I can do this easily using NetUI tags but I wish todo page
    specific dynamic calculation on the content of the bean.. Something like
    <%
         Bean b = getMyBEan() //how do I get it??
         //do some calculations on b
    %>
    Oliver Billing

    Hi Oliver
    Using pageContext
    One way to access it is adding the pageflow variable (bean) to the pagecontext and then you can use the getAttribute method in the jsp and get the value.
    More info at http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/netui/guide/conDatabindingXScript.html (Look under the section pageContext)
    Previous Posting at: http://forums.bea.com/bea/message.jspa?messageID=202357479&tstart=0
    Thanks,
    Vimala

Maybe you are looking for

  • Múltiplas NFes de entrada em um email

    Boa tarde senhores, Há algumas semanas percebi que a implementação "padrão" que fizeram da NFe de entrada considera apenas uma nota por email (unbelievable!). Além disso, pega o primeiro anexo e toca ficha... se esse primeiro anexo for o pdf com a da

  • Final Cut Pro 7 Setup/workflow

    Hello there, I work at a small company and we are starting to build large amount of raw tape and capture scratch data. I am writing to learn about best practices, procedures, and troubleshooting techniques. We have two editors who both work off Macs

  • FD32 Credit Exposure not updating

    Hi All, I am creating sales order where system is working fine to blocking sales order due to credit limit. But that credit amount is not updating in credit exposure in FD32, instead it is showing 0.00 value. Any clue.................highly appreciat

  • ALV OOPS report - Need help

    Hi Friends, I just want to convert a normal alv grid report to ALV OOPS report using classes,methods and objects, can you please help me on it. *I have sent a sample ALV grid report program. REPORT  YSDB_ALV_ECC NO STANDARD PAGE HEADING LINE-SIZE 260

  • HfmCopyAppCmd.exe

    Hi, Can any one help me on how to execute the HfmCopyAppCmd.exe. I prepared the soure and the destination UDL and the applications. Now how should I run. Do I need to create a batch file with HfmCopyAppCmd.exe source and dest. information and save it