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..

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 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

  • How to display a html report on jsp page---urgent

    i want to display a html report wen a tab is clicked.can any tell me how to do tat.

    Didn't quite get your requirement. What do you mean by an HTML report?

  • Read textfile in JSP (Very urgent� Pls Help)

    Hi to all,
    I have a very urgent problem. I need a JSP to read a textfile (c:\abc.txt).and display in it to a space <in a body tag> in a HTML page. Does anyone have any idea? Thanks in advance.
    This is my HTML page.
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Display</title>
    </head>
    <body>
    <p>Text to display:</p>
    </body>
    </html>

    Usually, I would prefer to put the jsp code scriplets at the beginning if its purpose is to generate a string....
    <%@ page contentType="text/html"
    import="java.io.*, java.util.*" %>
    <%
      String fileName = "c:\\abc.txt" ;
      BufferedReader br = new BufferedReader(new FileReader(fileName));
      String line = br.readLine() ;
      while ( line != null )
          out.write(line + "<br>");
          line = br.readLine() ;
      br.close();
    %>
    <html>
    <head><title>JSP Page</title></head>
    <body>
    <p>
    <%= line%>
    </p>
    </body>
    </html>

  • Jsp project -urgent

    can any one pls get me a demo project(jsp) on online store urgently for university purpose

    Try this
    http://java.sun.com/blueprints/code/index.html
    Fred

  • Visible Beans and JSPs. URGENT

    Can I use a visible bean on a JSP page? I mean, can I load the graphics part of a visible bean on an HTML page or something similar?
    I need to know if I can do that, and if it's possible, how I can do it. This is very urgent.

    I know I can load an applet and have a JSP communicate with it. My concern is that if I can load a graphical interface contained in a bean without using applets, on a JSP.
    And please, if this is possible, provide a little sample.

  • 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

Maybe you are looking for

  • DVD Drive disappeared after installing Boot Camp on Windows 8

    I am running Mountain Lion and I bootcamped Windows 8... this is a fresh install. 1. I installed Windows 8 and the DVD is still working 2. I installed Bootcamp software via DVD and was asked to reboot 3. I reboot my iMac 4. Now, my friggin DVD doesnt

  • OAS 4.0.8.1 : Windows 2000 Server : wrksf going down!!

    Hi, We have been facing this problem for quite some time now. Please let me know, if Oracle has come out with a fix on this. I found a fix for the Linux vesion of OAS 4.0.8.1, but could not find one for Windows. How do I go about solving the followin

  • Blackberry Desktop Software Error 0x80043ac9

    Hi all, I have a 9800 Torch and I use a wire/cable sync with the latest version of Blackberry Desktop Software 6.0.2.44.  It was working fine but now I am getting a message as it syncs the calendar that reads "Error Encountered.  Error Code 0x80043ac

  • Album Art Screwed Up

    I have all of the correct album art set-up. All of the names and info is right. The album art is correct on the computer, however, when I go to my iTouch, the album art is messed up. It is taking other art from other albums and putting it in random o

  • Enable Safe Mode in Windows 8 (legacy style)

    Hi all. I was looking around and found this gem. Run Command prompt as Admin and type (copy/paste the following line in command prompt): bcdedit /set {default} bootmenupolicy legacy press enter.  Safe mode can now be accessed using f8 (NORAMLLY) at t