JSP-HTML communication

          I have a HTML form that supplies 3 parameters to a jsp file. Inside the Jsp file,
          I validate those 3 parameters and throw an exception if any of them are null.
          How would I tell the HTML file if there happens an exception in the Jsp file.?Thanks
          

one approach is inform thru the query string the posting page.
          other appraach is use the server variables collection to determine the
          referrer(i.e the calling page)
          Oscar Dash <[email protected]> wrote in message
          news:[email protected]..
          >
          > Ok, I converted my form into a jsp as well. When an exception occurs, I am
          doing
          > sendError(500) from the target jsp. How does the first jsp (one who is
          posting
          > the data) knows about that error code?
          >
          > Michael Young <[email protected]> wrote:
          > >Hi.
          > >
          > >You can't tell the html file anything, really. HTML files are static
          > >and dumb. To do
          > >anything intelligent in a form you will probably need to convert it to
          > >a JSP as well in
          > >order to code some intelligence into it.
          > >
          > >Regards,
          > >Michael
          > >
          > >Oscar Dash wrote:
          > >
          > >> I have a HTML form that supplies 3 parameters to a jsp file. Inside
          > >the Jsp file,
          > >> I validate those 3 parameters and throw an exception if any of them
          > >are null.
          > >> How would I tell the HTML file if there happens an exception in the
          > >Jsp file.?Thanks
          > >
          > >--
          > >Michael Young
          > >Developer Relations Engineer
          > >BEA Support
          > >
          > >
          >
          

Similar Messages

  • How do you make JSF draw frame in browser w/o JSP & HTML ?

    Hi all,
    I already have small web application which uses HTML & JSP and I want to convert it to JSF based application.
    I've read O'Reilly JSF books written by Hans Bergsten and in Chapter 15 he states that you can use pure Java classes only (without JSP & HTML) in your web application.
    My web application contains some frames. Since I only want to use pure Java classes using JSF what component should I use to draw frame ?
    I use MyFaces implementation of JSF.
    Any advice would be greatly appreciated.
    Best Regards,
    Setya

    I don't know anything about myFaces, but as far as I know, there is no component to draw frames. The JSF book you read is correct to a degree... It's possible to write completely with JSF tags, but it can be cumbersome sometimes.
    To output frame tags using a JSF tag, you can use one of two methods.
    First, you can use the outputText tag with escape attribute set to false.
    <h:outputText value="<FRAMESET blah blah blah>" escape="false" />The second way is to just wrap HTML in f:verbatim tags.
    <f:verbatim><FRAMESET blah blah blah></f:verbatim>If using the second method, be careful not to have any other JSF tags inside the f:verbatim tags.
    Hope this helps,
    CowKing

  • How to convert the source code in JSP,HTML&BEANS into executable files?

    Sir,
    We are developing one s/w product in JSP,HTML&BEANS.Now we are in the implementation phase.During the time of Installation,without copying our source code in the customer's site I want to copy the executable files of the entire source codes? Is it possible in JSP,HTML&BEANS?

    In theory you can do it even with JSP but the you will be unable to run it on the standard JSP engine. :-)
    From other hand, all critical logic should be in the Java Beans or at least in custom tags but not in the JSP code. Then you can protect that code and leave JSP open because there is nothing to steal or break.

  • How to get the size of JSP html output?

    Hi,
    Is there a JSP method to get the size of JSP HTML output.
    e.g. I would like to print the size of the JSP e.g.
    Size of this page is <%=pageContext.getPageSize()%> Kb ???
    Any ideas? Thanks.
    George
    Edited by: googchro on Jan 5, 2010 4:45 PM

    Would you like to print "the size of this page is..." before or after you calculate the size of the page.
    Because adding that bit of text to the page will make the page bigger...
    Doing it in java, the best approach would probably to have a filter counting the number of bytes that gets sent to the writer/output stream.
    A client side tool measuring the amount of bytes received would probably be easier though.
    You can always look at the Content-length header sent with a response. Though you normally don't have access to that on the java/jsp side, as it is sent by the container.
    cheers,
    evnafets

  • Print JSP/HTML Pages (perhaps PDF?)

    Hi,
    i have a table in HTML generated by JSP.
    Just like the following simple example:
    ...<table>
    <%
    for( Enumeration et = free.getSqlIDs().elements(); et.hasMoreElements();)
    String keyt = (String)et.nextElement();
    Bean b = new Bean();
    b.init(path,DB);
    b.setID(keyt);
    b.restore();
    %>
    <tr>
    <td>
    <%out.print(b.getName());%>
    </td>
    <td>
    <%out.print(b.getAdress());%>
    </td>
    </tr>
    %>
    </table>...
    No i want to give a button to the user. When pressed, the HTML-Page should transform to PDF.
    With such a method i want to print the HTML-Page.
    I Know that this is possible with the help of XML/XSP and a stylesheet. But i like to do that with this way:JavaBeans-->JSP-->HTML-->PDF
    Anyone a solution, some code examples for me?
    Or perhaps another solution to print HTML-Pages in a fine design?
    Thank you for your help
    Andy

    Hi,
    no one any idea?
    How do you print Jsp Pages?
    Thank you
    Bye
    Andy

  • Tomcat Vs Weblogic .. jsp/html file path issue..

    Tomcat gurus, please help !!!
    Development Env. :
    OS: Window NT 4.0 SP6
    Web Server: Tomcat 4.1.12
    Sun JDK 1.3.1
    IDE : Eclipse 2.1
    Deployment/Testing/Prod Env:
    OS: Sun Solaris 2.8
    Web Server: Weblogic 5.1 SP 12
    Sun JDK 1.3.1 IDE : N/A
    Confession: New to Tomcat world.
    Note: Reason why I'm using Tomcat for development though I can use Weblogic, Eclipse IDE with Tomcat plugin provides debuging functionality, thus the problem. I have an enterprise application being built and kind of stepped into a problem. I have a Servlet that marshals all the calls and process them through java beans ( about 50+ ) and content displayed through JSPs.
    Here is the directory structure,
    /AppContext
    | +- src
    | +- com.xyz.wfservices
    +- jsp
    main.jsp
    +- WEB-INF
    |
    + classes
    + com.xyz.wfservices ( compiled classes )
    For Weblogic: It has 2 parameters to specify where the compiled code is and where the docs are,
    => weblogic.httpd.servlet.classpath=c:/wfservices/WEB-INF/classes
    => weblogic.httpd.documentRoot= c:/wfservices/src/html
    and to register instance,
    weblogic.httpd.register.WfServices=com.xyz.wfservices.WfSvcsController
    weblogic.httpd.initArgs.WfServices=\
         main.properties=c:/wfservices/src/properties/wfservices.properties
    But, I looked at Tomcat it is quite different.. it has <Context path="/wfs" docBase="L:\app_services\wfservices" workDir="L:\app_services\wfservices\work" /> Servlet def in web.xml
    <servlet>
    <servlet-name>WfServices</servlet-name>
    <servlet-class>com.xyz.wfservices.WfSvcsController</servlet-class>
    <init-param>
    <param-name>main.properties</param-name>
    <param-value>c:\wfservices\properties\config.properties</param-value>
    </init-param>
         <servlet-mapping>
              <servlet-name>WfServices</servlet-name>
              <url-pattern>/WfServices</url-pattern>
         </servlet-mapping>
    </servlet>
    Probem: Accessing JSP/Html ... documents. weblogic accessing / calling jsp ..
         rd = req.getRequestDispatcher("/main.jsp");      //req is HttpRequest
         if (rd != null)
              rd.forward(req, resp);
    The same does not work under Tomcat because it can find files relative to the context, thus it fails. I have to change the code like below to make it work.
         rd = req.getRequestDispatcher("/src/jsp/main.jsp");
         if (rd != null)
              rd.forward(req, resp);
    It is a nightmare now to maintain two different environments and more over changing all the references and and its internal references is not feasible. The question is, is there a way to configure docBase in tomcat so that I won't need a code change.
    Any help or inputs are greatly appreciated.
    Thanks
    Meher

    I ran into this same problem before, so I created a utility class that would map out a URI or URL given a relative path. It's nice because it will detect and include non-standard ports for both the HTTP and HTTPS protocols. If you access a servlet/jsp using HTTP, it will return a URL for the HTTP protocol and the same for HTTPS. So, that means you don't need any code changes to access things through HTTP or HTTPS :) Here it is, hope it helps you out:
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ContextMapper
        private static final int HTTP_PORT = 80;
        private static final int HTTPS_PORT = 443;
         * This method will return a URI to access a resource given its relative
         * path.  Please note that the relative path should start in the directory
         * where the web application is deployed to.
         * @param HttpServletRequest request
         * @param HttpServletResponse response
         * @param String relativePath
         * @return String
        public static String getUri (HttpServletRequest request, HttpServletResponse response, String relativePath)
            return request.getContextPath() + relativePath;
         * This method will return a URL to access a resource given its relative
         * path.  Please note that the relative path should start in the directory
         * where the web application is deployed to.  Also, the protocol will be
         * automatically detected from the request.  Supported protocols include
         * HTTP and HTTPS.  For all other protocols, the relative path will be
         * returned unmodified.
         * @param HttpServletRequest request
         * @param HttpServletResponse response
         * @param String relativePath
         * @return String
        public static String getUrl (HttpServletRequest request, HttpServletResponse response, String relativePath)
            if (request.getProtocol().startsWith("HTTP/") == true)
                switch (request.getServerPort())
                    case HTTP_PORT:
                        return "http://" + request.getServerName() + request.getContextPath() + relativePath;
                    default:
                        return "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + relativePath;
            else if (request.getProtocol().startsWith("HTTPS/") == true)
                switch (request.getServerPort())
                    case HTTPS_PORT:
                        return "https://" + request.getServerName() + request.getContextPath() + relativePath;
                    default:
                        return "https://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + relativePath;
            else
                return relativePath;
    }Here are a few examples of using this class:
    String uri = ContextMapper.getUri(request, response, "/css/basic.css");
    String url = ContextMapper.getUrl(request, response, "/css/basic.css");
    String uri = ContextMapper.getUri(request, response, "/images/image.gif");
    String url = ContextMapper.getUrl(request, response, "/images/image.gif");
    String uri = ContextMapper.getUri(request, response, "/jsp/HelloWorld.jsp");
    String url = ContextMapper.getUrl(request, response, "/jsp/HelloWorld.jsp");
    String uri = ContextMapper.getUri(request, response, "/servlet/HelloWorld");
    String url = ContextMapper.getUrl(request, response, "/servlet/HelloWorld");

  • JSP, HTML, CLASS, JAVASCRIPTS TO EXE OR PACKAGES

    Sir / Madam,
    I am a student, I am learning by myself. Plz help me.
    Can we create a package or exe which contains all JSP , HTML and their corresponding Images and Javascripts. Then extract in the server.
    ie: Server should not contain source code. It should in the form of EXE or other forms.
    Expecting Early replay.
    Thank You,
    Rengaraj

    hI renga_murali, well here is my openion about your thread. Hope you will get what you are looking for exactly.
    JAR files = collection of class files
    WAR files = collection of class, JSP, XML files
    EAR files = collection of JAR, WAR, and EJBs
    There are no structural differences between the files; they are all archived using zip/jar compression. However, they are intended for different purposes.
    Jar files (files with a .jar extension) are intended to hold generic libraries of Java classes, resources, auxiliary files, etc.
    War files (files with a .war extension) are intended to contain complete Web applications. In this context, a Web application is defined as a single group of files, classes, resources, .jar files that can be packaged and accessed as one servlet context.
    Ear files (files with a .ear extension) are intended to contain complete enterprise applications. In this context, an enterprise application is defined as a collection of .jar files, resources, classes, and multiple Web applications.
    Each type of file (.jar, .war, .ear) is processed uniquely by application servers, servlet containers, EJB containers, etc.
    ALSO REFER :
    Creating a JAR File : http://java.sun.com/docs/books/tutorial/jar/basics/build.html
    Creating a WAR File :
    http://access1.sun.com/techarticles/simple.WAR.html
    Creating a EAR File :
    http://access1.sun.com/techarticles/DissectingEARs/DissectingEARs.html
    Threads :
    http://forum.java.sun.com/thread.jspa?threadID=483657&messageID=2258904
    http://forum.java.sun.com/thread.jspa?threadID=455102&messageID=2075155
    Explaination :
    http://www.cezwright.com/tools/java/jar_war_ear.htm

  • Jsp&html urgent

    hello ,
    Im writing a page that uses the ahref attribute to navigate bw two JSP pages and the pages do some queries . i need to process the queries based on the value which the user clicks Can anybody help mw out to pass values in Ahref syntax and capturing it in the next Jsp page
    Thankx

    hello ,
    Im writing a page that uses the ahref attribute to
    navigate bw two JSP pages and the pages do some
    queries . i need to process the queries based on the
    value which the user clicks Can anybody help mw out
    to pass values in Ahref syntax and capturing it in
    the next Jsp page
    ThankxPal,
    u mean u'l hav a link(ie <a href attrib....>) in both the jsp pages..n those queries if done for accessin a database cud b dne bettre using a bean....anyways
    Pls b comprehensive about ur requirements...
    This is whut i thought of :take this code ..hope it'l b of some use..
    empbean.jsp:
    <Html>
         <Body><Center>
         <jsp:useBean id="eb" class="employee.EmpBean" />
         <jsp:setProperty name="eb" property="ename" value="coolx"/>
         <jsp:setProperty name="eb" property="ejob" value='"chief architect"/>
         <H1>
         The Employee Name is set to :
         <jsp:getProperty name="eb" property="ename" />
         <Hr>
         The Employee Job is set to :
         <jsp:getProperty name="eb" property="ejob" />
         </H1>
         </Center></Body>
    </Html>
    2. empbean.java
    package employee;
    public class EmpBean
         private String ename;
         private String ejob;
         public void setEname(String nm)
              ename=nm;
         public String getEname()
              return(ename);
         public void setEjob(String jb)
              ejob=jb;
         public String getEjob()
              return(ejob);
    Hope u kno about beans..if dont , in short a special class with zero parameter constructor and havin accessor and mutator methods to access the bean properties..
    Here this jsp page creates a bean object and passes on the parameters to the bean through bean properties tag..

  • Jsp/html form- servlet- xml parsing

    does anyone have an example or know of a place where I can get code
    which passes XML from jsp/html to servlet which parses the xml???
    will be appreciated..........thanks

    Hi,
    Are u trying to acheive indpendent of browser solution or just want to know the things..
    well,I have one idea ok.
    Using JavaScript Constructs the XmL as u want, "let say
    <root><name>Lokesh</name><age>25</age></root>" before submitting the page(I mean frm.submit()) assign to a hidden variable, since you have post kind of submit back at the servlet from the request object get the value and store it as String and using StringReader you just parse the XML
    Just try the above one the below code
         public org.w3c.dom.Document getXMLDocument() throws IllegalStateException,Exception
                        if (!containsXMLDocument())
                                  throw new IllegalStateException("This request does not contain an XMLDocument");
                   javax.xml.parsers.DocumentBuilderFactory dbf=javax.xml.parsers.DocumentBuilderFactory.newInstance();
                   javax.xml.parsers.DocumentBuilder db=dbf.newDocumentBuilder();
                   java.io.StringReader strRdr=new java.io.StringReader(_xmlString);
                   org.xml.sax.InputSource ipSrc=new org.xml.sax.InputSource(strRdr);
                   org.w3c.dom.Document doc=db.parse(ipSrc);
                   return doc;
    best of luck..
    With Regards
    Lokesh T.C

  • Create Form Beans from JSP/HTML forms

    In the Builder certification objectives, there is one called "Create Form Beans from JSP/HTML forms". How can I do that? How can I create a form beam starting from the JSP form or HTML form?

    Guys, no one from forum can answer this question?

  • Controlling printmargins with java/jsp/html

    I was wondering if there is any way to set the standard margins in browser to 0.
    As for Firefox, the settings for top, bottom and both sides margins are sat to 12,7.
    Is there any way for my application to set this values (including all other browsers as well) to print what I am presenting in my viewing.
    I have a webpage that I want the user to get a "printer friendly" new page which controlles the margins for the print.
    As for now, the print has these "standard" values to have the page centered arround white space which I want to get rid of.
    The webpage itself is shown perfectly when I manually set the marings to 0, but for someone who doens't know how to set these would get the first page printed on the first side, and then the leftover at the start on page 2.
    Is there a way to do this with jsp/html/java? So that the printmargins are sat to 0 at eah "printer friendly" page?
    Please advice - got myself stuck here;) -,
    Cincerely P�l

    Then this might not be a suited javaquestion;) But do you know where to start searching for a solution. I've been googling all over the place for a hint on how to sort this out.
    P�l

  • JSP HTML parameter form to call report - Dependent  drop down list

    I have a report parameter form developed using HTML & JSP to call oracle reports6i.
    First parameter "STATES", Second Parameter "CITY"
    I have a master-detail relation betwen STATE & CITY table.
    I want the parameter form drop down lists dependant. ie if the user chang STATE value in the first drop down, the second drop down list CITY shoud
    change automatically.
    Please help
    Thanks
    Vimal

    Vimal,
    This is not functionality that's available in the Reports generated parameter form. In order to do this you'll need to build the parameter form yourself as a true HTML form and code the javascript to link the fields.
    Hope this helps,
    Danny

  • JSP / HTML page does not load correctly in IE

    I have a particular jsp page, which has heavy volume of data and it does not load completely in IE, but loads perfectly in Firefox and Safari.
    It is a really perpleximg problem that occurs only when the volume of data is large. None of the people in my team were able to solve this issue.
    Please send in your suggestions as to why this is happening or if there are any known bugs in IE.
    In case you need an HTML version of the code, please do mail me at [email protected]

    Jaison_Sabu wrote:
    I have a particular jsp page, which has heavy volume of data and it does not load completely in IE, but loads perfectly in Firefox and Safari.
    It is a really perpleximg problem that occurs only when the volume of data is large. Why would you be sending large amounts of data to a JSP? Sounds fishy to me.
    None of the people in my team were able to solve this issue.Well if you provided your team with the same amount (none) of information you provided here, then I would understand.
    Please send in your suggestions as to why this is happening or if there are any known bugs in IE.Personally, I think it's the flux capacitor.
    In case you need an HTML version of the code, please do mail me at [email protected]
    Hope you're ready for some spam.

  • Dynamic text box generation in jsp page by using net-ui jsp html tags

    Hi All,
    I Need to generate the "TextBoxes" Dynamically by using the "Net-UI HTML Tags".How can i do this ?
    I am using
    1. WebLogic portal server 8.1 sp4 (Workshop dev environment)
    2. JavaPageFlow Applications
    3. Net-UI tags html jsp
    I need to generate the textboxes dynamically and i have to
    get those values in the page flow .
    How it is possible by using the "Net-UI Tags".
    Thanks In Advance,
    KiranBabu.Karusala

    how we create dynemic text box in jsp based one value which we give at runtime

  • Invalid content type for SOAP: TEXT/HTML:communication channel modification

    Hello ,
    While delivering an async message from XI to thirdparty, getting an error 'invalid content type for SOAP: TEXT/HTML' in the RWB/adapter engine
    I need to modify Module tab for MessageTransformBean / content type as text/html.
    Can anyone tell me how to do this in SOAP communication channel?
    Thanks in advance

    Hi,
    Thanks for ur help...
    I've tested with soapUI and it is working fine. When I send the data from soapUI , it is reaching to third party and I get response as 'success' So the url is also fine.
    The same data when XI is sending it is throwing an error.
    One more thing here -- The XI server is in intranet and TP is in DMZ .... there is a firewall in between them...
    1. When I execute thr soapUI (from intranet) it is reaching to TP (DMZ)
    2. When I execute thr XI (intranet) its throwing an error.
    Is this because of firewall settings ?
    Thanks..

Maybe you are looking for

  • How do i retrieve my legacy filevaulted user?

    So, here's what happened. I have an early 2008 black macbook. it was running lion. Then, last saturday, I had to force it to turn off and, after that, I wasn't being able to sign into my account again. It entered an infinite loop. I tried everything,

  • 4KE5 not allocating Balance Sheet Accounts

    We created a new cycle for 2011, when we run 4KE5 we noticed that only expense accounts are being allocated correctly but balance sheets are not being allocated for a specific profit center. This was working in 2010. These accounts are non-recon acco

  • Problem in converting spool to pdf

    Hi Experts, I want an internal table to be converted to the PDF. For this RSPO_OPEN_SPOOLREQUEST, RSPO_WRITE_SPOOLREQUEST and RSPO_CLOSE_SPOOLREQUEST to create the spool. However, somehow the table tsp01 does not gets updated as a result i could not

  • Adpreclone.pl Non-interactive Mode

    Hi All, want to automate backup of APPL tier To do that it is required to run adpreclone.pl with non-interactive mode i.e. It will not ask for any password when it will run through shell script. Or something like perl adpreclone.pl appsTier pwd=<> Is

  • Item Level Determination

    Hello SAP Gurus, I have a small confusion, we can do header level determination for ORG, Partner, so why we need Item Level determination for Org., and Partner. Once the partner determination is done in header level during transaction then is it nece