Pagination with orcale and jsp

hi, i m new to java can any one tell me how to do pagination with my this codes
String sqlCount = null;
String sql = null;
sql = "select * from HOME_LEASE_ ";
sqlCount = "select count(*)from HOME_LEASE_ ";
Enumeration e = request.getParameterNames();
int i = 0;
while(e.hasMoreElements()){
String name = (String)e.nextElement();
String search = new String(request.getParameter(name)).toUpperCase();
if(i != 0 && (!search.isEmpty())){
sql = sql +" and " + name +" like'" + search + "%'" ;
sqlCount = sqlCount + " and " name" like '" + search + "%'" ;
}else if((!search.isEmpty()) && (i == 0) ){
sql = sql + " where " + name +" like '" + search + "%'" ;
sqlCount = sqlCount + " where " + name+" like '" + search + "%'" ;
++i;
if((sql != null) && (sqlCount != null)){
DataAccess dB = new DataAccess();
Connection conn = dB.getConnection();
Statement stmtCount = dB.createStmt(conn);
ResultSet rsCount = dB.executeQuery(sqlCount,stmtCount);
rsCount.next();
Statement stmt = dB.createStmt(conn);
ResultSet rs = dB.executeQuery(sql,stmt);
<% if(rs == null)
out.println("<h3>No data found</h3>");
else
//out.println(rs.next());
while(rs.next()) {
//out.println("inside the result set");
out.println("<tr>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("phase") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("file_no") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getString("se") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getString("str") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getString("qrno") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getString("typ") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("perno") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getString("name") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("total_plot_area_ocp") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("TOT_PREM_AREA") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getInt("total_construction") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getLong("chargbl_construction") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getLong("add_open_construction") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getLong("TOT_PREM_AREA") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getLong("plinth") + "</a></td>");
out.println( "<td><a href=survey.jsp?phase="+ rs.getString("phase")+"&file_no="+rs.getString("FILE_NO")+">"+ rs.getLong("std_plot_area") + "</a></td>");
out.println("</tr>");
dB.close(rsCount);
dB.close(stmtCount);
dB.close(rs);
dB.close(stmt);
dB.close(conn);
}else{
out.println("<center style=\"background-color:red\">Please enter values in text fields<h1></h1></center>");
%>

After examining your code, I think:
You are not using JSP/HTML properly (using java to write out HTML). You can spend a tremendous amount of time with trial and error approaches in learning a technology and still not get much real understanding for your effort. I suggest a better use of those hours would be spent in reading a book on Java first, then a book on JSP. For a book on JSP, go to amazon.com and search for 'Javaserver pages'. Find a book that isn't too old and that has good reviews. Here is one (although its a bit dated):
http://www.amazon.com/JavaServer-Pages-Edition-Hans-Bergsten/dp/0596005636/ref=sr_1_1?s=books&ie=UTF8&qid=1338821741&sr=1-1
As far your database code goes, I suggest you read on-line articles on JDBC on how to get/use/close a database connection in a try/catch/finally block. The article will probably also help you write better SQL too. I don't think your question on pagination should be tackled until you learn JSP.

Similar Messages

  • How to master good design with EJB and JSP?

    I use JSP to calling EJB. But the .jsp file is complex and it's difficult to maintain...I just want to work higher efficent with EJB,JSP and JavaBean. I want to know is there a good design with EJB and JSP? and is there any good material about MVC for EJB,JSP and JavaBean?

    You should read the J2EE blueprint available on this website. Better download the PDF, and print it for yourself so you can read it anytime.

  • Where do I get started with OAS and JSP ?

    Where do I get started with OAS and JSP ?
    Resources?
    Please point me in the right direction!
    Post and/or email me at [email protected]

    The simplest way is to read OAS4082 Documentation:
    Developer's Guide: JServlet and JSP Applications.

  • Creating FOrums with Servlet and JSP

    Hi everyone,
    Is there a good resource that explains how to build a forum using servlets and JSP technology?
    Regards,
    Basil Mahdi

    please let me know here if you find any useful resources...I am in the process of writing my own searchable threaded forum for my company with JSP's/servlets. It's a very slow process at the moment though...if I ever finish it, I'll gladly share it.

  • Connecting databeses with WML and JSP pages..!

    I need information about how to connect databases with wap technologies using wml and jsp , I am waiting your resources, codes and helps.. And I would like to remind you , I am beginner about this topic , Only things that I know are Jsp and WML , I have no experience about wap and how to combine wml and jsp , So please be helper while you send your messages , If all your messages contains much detailed and supported complete sources and files , it will more helpfull for me ..
    Thanks in Advance.
    P.S : 1- ) if you want to contact direclty , mail address : [email protected]
    2-) Don't post me complex references' URL , I have already made search on google,yahoo and etc

    Additionally , I would like to learn what I have to need for this project .. Now , I already have winwap wap emulator and Websphere Studio.. Do I need special wap server or something else to test my applications..
    Please , hurry up .. I really need your helps..
    Ergin

  • Problem with JNDI and JSP in Tomcat

    Hi,
    Basically, what I've done is to use the Tomcat administration web
    application to create the DataSource, which looks like it populated the
    server.xml (see below). I then try to access the testconn.jsp, and am
    getting that "Name java:comp is not bound in this Context" error.
    I was wondering if anyone could tell me what I'm doing wrong?
    Thanks,
    Feri
    My Configuration:
    - Tomcat 5.0.19
    - MySQL 4.0.18-nt
    - mysql-connector-java-3.0.15-ga-bin.jar
    server.xml:
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    <!--Feri test JNDI-->
         <Context crossContext="true" debug="5" docBase="injury" path="/injury" reloadable="true">
         <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_injury_log." suffix=".txt" timestamp="true"/>
              <Resource name="jdbc/injury" auth="Container"
    type="javax.sql.DataSource">
    </Resource>
    <ResourceParams name="jdbc/injury">
         <parameter>
              <name>factory</name>
              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
         </parameter>
    <parameter>
    <name>username</name>
    <value>root</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>root</value>
    </parameter>
         <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
         <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost:3306/injury</value>
    </parameter>
         <parameter>
              <name>maxIdle</name>
              <value>30</value>
         </parameter>
         <parameter>
              <name>maxActive</name>
              <value>10</value>
         </parameter>
         <parameter>
              <name>maxWait</name>
              <value>10000</value>
         </parameter>
    </ResourceParams>
         </Context>
    <!--Feri test JNDI end-->
    </GlobalNamingResources>
    \webapps\injury\WEB-INF\web.xml:
    <resource-ref>
    <description>Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file.</description>
    <res-ref-name>jdbc/injury</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    \webapps\injury\testconn.jsp
    <%@ page import="java.sql.*" %>
    <%@ page import="javax.sql.*" %>
    <%@ taglib prefix="ct" uri="/injury" %>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
    <h1>Connection test</h1>
    <ct:connection name="jdbc/injury">
    <%
    Statement stmt= conn.createStatement();
    ResultSet rs;
    rs = stmt.executeQuery("select * from user");
    while (rs.next()){
    %><%=rs.getString(1)%><%=rs.getInt(2) %><br><%
    rs.close();
    stmt.close();
    %>
    </ct:connection>
    ConnectionTag.java
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import javax.naming.*;
    import javax.sql.*;
    import javax.sql.DataSource;
    public class ConnectionTag extends TagSupport implements TryCatchFinally {
    private Connection conn;
    // JNDI name of the connection
    private String name;
    public void setName(String name)
         this.name = name;
    public int doStartTag()
         throws JspException
         try {
         Context env = (Context) new InitialContext().lookup("java:comp/env");
         DataSource ds = (DataSource) env.lookup(name);
         if (ds != null)
              conn = ds.getConnection();
         } catch (Exception e) {
         throw new JspException(e);
         if (conn == null)
         throw new JspException("can't open connection " + name);
         pageContext.setAttribute("conn", conn);
         return EVAL_BODY_INCLUDE;
    public void doCatch(Throwable t)
         throws Throwable
         throw t;
    public void doFinally()
         try {
         Connection conn = this.conn;
         this.conn = null;
         pageContext.removeAttribute("conn");
         conn.close();
         } catch (Exception e) {
    Tomcat 5.0\conf\Catalina\localhost\injury.xml
    <?xml version='1.0' encoding='utf-8'?>
    <Context displayName="Injury" docBase="E:\Tomcat 5.0\webapps\injury" path="/injury" className="org.apache.catalina.core.StandardContext"
    cachingAllowed="true" charsetMapperClass="org.apache.catalina .util.CharsetMapper" cookies="true" crossContext="false" debug="0"
    mapperClass="org.apache.catalina.core.StandardContextMapper" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper" >
    <Resource auth="Container" description="Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file." name="jdbc/injury" type="javax.sql.DataSource"/>
    <ResourceLink global="jdbc/injury" name="injury" type="javax.sql.DataSource"/>
    </Context>

    Hi,
    First of all, you can find alot of information about this in the forum about jsp's.
    I think a good thing to do is not to put your context tag directly into the server.xml file.
    What you should do is create a context.xml file with the context-tag in it, and put it in the META-INF directory of your .war file. Upon deployment to tomcat5 this file will be extracted from the war, copied to the conf\enginename\hostname directory, and it will be renamed to contextName.xml.
    I think you are developing directly into the webapps directory, and I believe you should avoid that and use the deployment feature of the manager web-app or you should use the deployertool from you ide or standalone ant.
    anyway, for starters try to remove the context tag from the server.xml file as described above, and check out the jsp / jdbc forums for simular problems and answers.
    good luck

  • Need help with Tomcat and JSP

    Hi
    I'm a complete beginner with JSP, I have experience with Java, Dreamweaver and HTML, but I'm having alot difficulty understanding JSP.
    I tried doing out some of the tutorial examples but they don't seem to come out right on the browser.
    For Example the Code for Date
    <HTML>
    <BODY>
    <%
    // This is a scriptlet. Notice that the "date"
    // variable we declare here is available in the
    // embedded expression later on.
    System.out.println( "Evaluating date now" );
    java.util.Date date = new java.util.Date();
    %>
    Hello! The time is now <%= date %>
    </BODY>
    </HTML>
    Comes out as
    <% // This is a scriptlet. Notice that the "date" // variable we declare here is available in the // embedded expression later on. System.out.println( "Evaluating date now" ); java.util.Date date = new java.util.Date(); %> Hello! The time is now <%= date %>
    I know this probably really sounds like a stupid question but what could be the problem?

    Those it have to saved on the desktop, or in the Tomcat webapps folder or what?It has to be in a web application under tomcat. The easiest one to get up and running with basic jsp is the webapps/ROOT directory which is where the main index page is.
    [url http://www.coreservlets.com/Apache-Tomcat-Tutorial/]This one is a good basic guide to installing/getting it running.
    Also the tomcat documentation itself is reasonable good. Of specific relevance to you would be [url http://tomcat.apache.org/tomcat-5.5-doc/appdev/index.html]Application developers guide which explains the basic layout/structure of a web application.

  • Problems with filters and jsp pages.

    I have the following simple filter that checks if there is user information in the session object and redirects accordingly:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginFilter implements Filter
         public void init(FilterConfig filterConfig) {}
         public void destroy() {}
         public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
         throws IOException, ServletException
              System.out.println("filter");
              HttpSession session = ((HttpServletRequest)request).getSession();
              String action = request.getParameter("action");
              if(action != null && !action.equals("login") && !action.equals("wronglogin"))
                   if(session.getAttribute("username") == null)
                        ((HttpServletResponse)response).sendRedirect("index.jsp?action=wronglogin");
                        System.out.println("User not OK, kicking out...");
                   else
                        chain.doFilter(request, response);
                        System.out.println("User OK, letting in...");
              else
                   chain.doFilter(request, response);
    }The filter is mapped to an admin page with the name index.jsp. However, I get an error for every <% and %> tag in the file (there are quite a few) when I use the filter with the page. The page works fine without the filter, and the filter seems to work with pages without scriptlets (without the <% and %> tags). Here is the beginning of the error report:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 6 in the jsp file: /admin/index.jsp
    Generated servlet error:
    Syntax error on tokens, AnnotationName expected instead
    An error occurred at line: 6 in the jsp file: /admin/index.jsp
    Generated servlet error:
    Syntax error on tokens, delete these tokens
    An error occurred at line: 6 in the jsp file: /admin/index.jsp
    Generated servlet error:
    Syntax error on token ";", [ expected
    An error occurred at line: 6 in the jsp file: /admin/index.jsp
    Generated servlet error:
    Syntax error on token ";", [ expected
    An error occurred at line: 6 in the jsp file: /admin/index.jsp
    Generated servlet error:
    Syntax error on token ";", [ expected
    Jasper gives me many errors per <% and %> tag. As you can see there is a <% tag on line 6. Any idea, why this does not work?
    Thanks!
    Message was edited by:
    chincillya

    What is the JSP scriptlet code at line 6 ?
    By looking at the code we can identify if there are any syntax errors, otherwise we can't really guess what might be the problem.

  • Has somebody who can help me please  with JavaMail and JSP ?

    I am new in JSP
    And I would wish to create a JSP to send an email with attachment.
    For the compilation of my JavaBeans I use JBuilder 9 Personnel version
    Then I have j2sdk1.4.0
    In C:\j2sdk1.4.0\
    For the installation of the API javamail
    it is necessary to download two jar files Mail.jar and activation .jar
    http://java.sun.com/products/javamail/javadocs/index.html
    it is done!
    then, I copied my two files mail.jar and activation.jar in the directory
    C:\j2sdk1.4.0\lib
    And in
    C:\jBuilder 9 \jdk1.4\lib
    I have family Windows XP
    Then from DOS in the the directory c:\ Documents and Settings\MEBARKIA
    I have to add this line:
    SET CLASSPATH=c:\j2sdk1.4.0\lib\mail.jar;c:\j2sdk1.4.0\lib\activation.jar;
    Finally,
    for a test, I downloaded an example of Javabean from : http://java.sun.com/developer/qow/archive/74/
    the source code is:
    import java.beans.*;
    import java.util.*;
    import java.io.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    public class XYZMail extends Object
    implements java.io.Serializable {
    private ArrayList mailTo
    = new ArrayList();
    private String mailFrom ;
    private String mailSubject ;
    private String mailMessage ;
    private String mailHost;
    private ArrayList mailAttachments = new ArrayList();
    private Properties props;
    private javax.mail.Session sess;
    private InternetAddress[] address
    = { new InternetAddress() };
    public XYZMail() {
    props = new Properties( ) ;
    props = System.getProperties();
    public long sendMail () throws MessagingException {
    props.put("mail.smtp.host", getMailHost() );
    sess = javax.mail.Session.getDefaultInstance(props, null);
    sess.setDebug( Boolean.valueOf( "false" ).booleanValue() );
    int i = 0;
    MimeMessage msg = new MimeMessage(sess);
    msg.setFrom(new InternetAddress( getMailFrom() ));
    for ( Iterator itr = mailTo.iterator( ); itr.hasNext(); ) {
    address[i] = new InternetAddress((String) itr.next()) ;
    msg.setRecipients(Message.RecipientType.TO, address);
    msg.setSubject( getMailSubject() );
    MimeBodyPart mbp1 = new MimeBodyPart();
    mbp1.setText( getMailMessage() );
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    if ( ! mailAttachments.isEmpty() ) {
    MimeBodyPart mbp2 = new MimeBodyPart();
    FileDataSource fds=new FileDataSource( (String)
    mailAttachments.get(0) );
    mbp2.setDataHandler(new DataHandler(fds));
    mbp2.setFileName( (String) mailAttachments.get(0) );
    mp.addBodyPart(mbp2);
    msg.setContent(mp);
    msg.setSentDate(new Date());
    Transport.send(msg);
    return 1;
    public ArrayList getMailTo ( ) {
    return mailTo;
    public String getMailFrom ( ) {
    return mailFrom;
    public String getMailSubject ( ) {
    return mailSubject;
    public String getMailMessage ( ) {
    return mailMessage;
    public ArrayList getMailAttachments ( ) {
    return mailAttachments;
    public String getMailHost ( ) {
    return mailHost;
    public void setMailHost ( String host ) {
    mailHost = host;
    public void setMailAttachments ( ArrayList attachments ) {
    mailAttachments = attachments ;
    public void setMailMessage ( String msg ) {
    mailMessage = msg ;
    public void setMailSubject ( String subject ) {
    mailSubject = subject ;
    public void setMailFrom ( String from ) {
    mailFrom = from;
    public void setMailTo ( ArrayList to ) {
    mailTo = to;
    I have all these error messages:
    "XYZMail.java" : Erreur No. 704 : acc?s impossible au r?pertoire javax\mail en ligne 6, colonne 1
    "XYZMail.java" : Erreur No. 704 : acc?s impossible au r?pertoire javax\mail\internet en ligne 8, colonne 1
    "XYZMail.java" : Erreur No. 704 : acc?s impossible au r?pertoire javax\activation en ligne 9, colonne 1
    "XYZMail.java" : Erreur No. 302 : classe javax.mail.Session non accessible ; aucune classe ni source trouv? pour javax.mail.Session en ligne 22, colonne 20
    "XYZMail.java" : Erreur No. 300 : classe InternetAddress introuvable dans classe gestionbadges.XYZMail en ligne 23, colonne 9
    "XYZMail.java" : Erreur No. 300 : classe MessagingException introuvable dans classe gestionbadges.XYZMail en ligne 31, colonne 32
    "XYZMail.java" : Erreur No. 300 : classe InternetAddress introuvable dans classe gestionbadges.XYZMail en ligne 24, colonne 9
    "XYZMail.java" : Erreur No. 302 : classe javax.mail.Session non accessible ; aucune classe ni source trouv? pour javax.mail.Session en ligne 34, colonne 19
    "XYZMail.java" : Erreur No. 300 : classe MimeMessage introuvable dans classe gestionbadges.XYZMail en ligne 38, colonne 1
    "XYZMail.java" : Erreur No. 300 : classe MimeMessage introuvable dans classe gestionbadges.XYZMail en ligne 38, colonne 23
    "XYZMail.java" : Erreur No. 300 : classe InternetAddress introuvable dans classe gestionbadges.XYZMail en ligne 40, colonne 17
    "XYZMail.java" : Erreur No. 300 : classe InternetAddress introuvable dans classe gestionbadges.XYZMail en ligne 42, colonne 18
    "XYZMail.java" : Erreur No. 302 : classe Message.RecipientType non accessible ; aucune classe ni source trouv? pour Message.RecipientType en ligne 46, colonne 27
    "XYZMail.java" : Erreur No. 300 : classe MimeBodyPart introuvable dans classe gestionbadges.XYZMail en ligne 50, colonne 1
    "XYZMail.java" : Erreur No. 300 : classe MimeBodyPart introuvable dans classe gestionbadges.XYZMail en ligne 50, colonne 25
    "XYZMail.java" : Erreur No. 300 : classe Multipart introuvable dans classe gestionbadges.XYZMail en ligne 53, colonne 1
    "XYZMail.java" : Erreur No. 300 : classe MimeMultipart introuvable dans classe gestionbadges.XYZMail en ligne 53, colonne 20
    "XYZMail.java" : Erreur No. 300 : classe MimeBodyPart introuvable dans classe gestionbadges.XYZMail en ligne 57, colonne 1
    "XYZMail.java" : Erreur No. 300 : classe MimeBodyPart introuvable dans classe gestionbadges.XYZMail en ligne 57, colonne 25
    "XYZMail.java" : Erreur No. 300 : classe FileDataSource introuvable dans classe gestionbadges.XYZMail en ligne 59, colonne 1
    "XYZMail.java" : Erreur No. 300 : classe FileDataSource introuvable dans classe gestionbadges.XYZMail en ligne 59, colonne 24
    "XYZMail.java" : Erreur No. 300 : classe DataHandler introuvable dans classe gestionbadges.XYZMail en ligne 61, colonne 25
    "XYZMail.java" : Erreur No. 300 : variable Transport introuvable dans classe gestionbadges.XYZMail en ligne 70, colonne 1
    Thanks for your's help!!!!!

    Thank you very much for your answer wew64.
    Yes, I have a local server TOMCAT
    But the problem
    It is on the compilation I do not arrive has to compile my javabean XYZMail java
    With jbuilder 4
    However I have to configure my CLASSPATH on the level of DOS
    And on the variables of enivrements of Windows XP.
    I copied the two files mail.jar and activation.jar everywhere
    In
    C:\j2sdk1.4.0\lib
    And in
    C:\j2sdk1.4.0\jre
    C:\j2sdk1.4.0\jre\lib
    Even case with
    c:\jBuider 4
    thanks.

  • SSI with weblogic and JSP

    Hi All
    I am sorry, if my question sounds irrelevant.
    1. Can we configure weblogic and apache to use server side includes (SSI) ? If yes please let me know how to do so.
    2. Can I have SSI's in my JSP?
    Thanks
    Prashant

    We have used mod_weblogic in apache and added
    Option +Includes
    for the location handled by Weblogic.
    But still the SSI directives are not processed by apache.
    Is there a way for apache to process SSI directives coming from Weblogic?

  • AppMod pooling with Servlets and JSPs

    Issue:
    I have a servlet that I need to do some work on a BC4J View Object (myVO), like set the where clause, execute, etc. I want to perform these actions in the servlet, and then forward on to a .jsp page (mypage.jsp). Then I want to use the BC4J Data Tag library to present the data. Normally, the AppMod tag would be used to get ahold of an AppMod, but in my case, I want to use the specific AppMod that I prepared inside the servlet that forwarded to mypage.jsp.
    I have looked through the BC4J Data Tag library and it appears that the data tags are getting the AppMod from the page context. I looked at the AppMod tag and I couldn't see exactly where it was sticking the AppMod into the page context, but when I looked at the DataSource tag, it was retrieving the AppMod from the page context. Therefore, I am assuming the AppMod tag is sticking it into the page context.
    What I would like to be able to do is perform some work on the AppMod in my servlet, then forward to a .jsp. Once in the .jsp, I would like to reference the AppMod without having to use the AppMod tag, but reference the AppMod directly from the DataSource tag. This would allow me to completely manage the AppMod interaction in my servlet, thus centralizing that logic and avoiding multiple check-ins/check-outs of the AppMod. I could also avoid using stateful management of the AppMod.
    Any insights would be much appreciated!
    Thx,
    Eric

    Core Servlets is pretty good. I have both parts.
    One day I'm actually going to read them.you mean these two right?
    Core Servlets and Javaserver Pages: Core Technologies, Vol. 2 (2nd Edition) (Core) by Marty Hall, Larry Brown, and Yaakov Chaikin
    Core Servlets and JavaServer Pages, Vol. 1: Core Technologies, Second Edition by Marty Hall and Larry Brown
    I should buy the Vol 1 first right?

  • Help with servlet and JSP

    I am creating a web application that allows users to submit questions and answers to a database. The users can also specify a number of questions and take a randomly generated test from the questions that have been submitted to the database. Currently, I am having trouble figuring out how to generate the test and then grade it. I was thinking I would use a question page that displayed a random question and its answers, allowed the user to answer the question and submit it, and then have the page reload with a new random question from the database. After the user has answered the number of questions they specified, then it would go to a results page with the percent and grade. I'm having trouble figuring out a servlet for the test generation. Any help would be much appreciated.
    Thanks, Mike
    [email protected]

    Please provide more information on exactly what the problem you are having is.
    For example: The following sentence you provide doesn't really say what the problem is:
    " I'm having trouble figuring out a servlet for the test generation."

  • Creating links to text files with Tomcat and JSP

    I am trying to create links in a JSP page that bring up text files. Currently, the links point to a file format. When the links are clicked, however, the text files are not displayed in the web browser. When an "http:" format is used, the links point to terminal files that are not being written dynamically (and therefore are useless to me). So in short, I'm looking for a way to get these links to (1) point to text files on the network, and (2) get them to display in a new browser window. Any help or guidance will be greatly appreciated.
    Thanks.
    TGD

    You cannot expect Tomcat or any J2EE Server to give access to the Network files.
    You need to design a different way to give access to the Users.
    What you can do is write a proxy (HttpServlet) which can pass a request parameter as the file name. The Servlet can read the file and then paint it in the Client Browser Window.
    Hope this helps.
    Thanks and regards,
    Pazhanikanthan. P

  • Continuing with html and jsp

    I have another problem, I am trying to print an image from my database into the img src areas...can someone please help me on this...I have hardcoded the image into the areas where i want them...so GK would be in the first row, the defenders in the next row, etc.
    <table border=1>
    <tr><td valign=top>
    <table cellspacing=23 bgcolor="olivedrab">
         <tr>
         <td></td>
         <td></td>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         <td></td>
         <td></td>
         </tr>
         <tr>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         <td></td>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         </tr>
         <tr>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         <td></td>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         </tr>
         <tr>
         <td></td>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         <td></td>
         <td><img src="Z:\destination\web\images\AFC.gif" width="75" height="86"></td>
         <td></td>
         </tr>
    </TABLE>
    <TD align = right width = 200 valign=top>
    <TABLE border=1><TR><TD align=center bgcolor=ffffc6>YOUR SQUAD</TD></TR>
    <TR><TD valign=top>
         <TABLE cellspacing=5><TR><TD colspan=3><I>STARTING XI:</I></TD></TR>
                        <TR>
                        <TD width=40 align=center></TD>
                        <TD width=40 align=center></TD>
                        <TD width=40 align=center></TD>
                        </TR>
    <BR>
    <%
    String email = (String)session.getAttribute("email");
    Class.forName("org.postgresql.Driver");
    // create connection url
    String URL = "jdbc:postgresql://dbhost/ug59sxn";
    // pass database parameters to JDBC driver
    Connection Conn = DriverManager.getConnection(URL, "ug59sxn", "hupeswop");
    // query statement
    Statement SQLStatement = Conn.createStatement();
    // generate query
    String Query = "SELECT playertable.position, playertable.pname, playertable.cost, images.image FROM userteam, playertable, images " +
                             "WHERE userteam.email ='"+email+"' AND playertable.pid IN(p1id, p2id, p3id, p4id, p5id, p6id, p7id, p8id, p9id, p10id, p11id) AND playertable.club=images.club ";
    // get result code
    ResultSet SQLResult = SQLStatement.executeQuery(Query);
    while(SQLResult.next())
              String pos = SQLResult.getString("position");
              String PId = SQLResult.getString("pname");
              String cost = SQLResult.getString("cost");
    String im = SQLResult.getString("image");
              if (pos.equals("GK"))
                   out.println("<tr><td bgcolor ='lightcoral'>" + pos + "</td><td bgcolor ='lightcoral'>" + PId + "</td><td bgcolor ='lightcoral'>" + cost + "m" + "</td></tr>");
              else if (pos.equals("DF"))
                   out.println("<tr><td bgcolor ='khaki'>" + pos + "</td><td bgcolor ='khaki'>" + PId + "</td><td bgcolor ='khaki'>" + cost + "m" + "</td></tr>");
              else if (pos.equals("MF"))
                   out.println("<tr><td bgcolor ='lightgreen'>" + pos + "</td><td bgcolor ='lightgreen'>" + PId + "</td><td bgcolor ='lightgreen'>" + cost + "m" + "</td></tr>");
              else
                   out.println("<tr><td bgcolor ='darkturquoise'>" + pos + "</td><td bgcolor ='darkturquoise'>" + PId + "</td><td bgcolor ='darkturquoise'>" + cost + "m" + "</td></tr>");
    // close connection
    SQLResult.close();
    SQLStatement.close();
    Conn.close();
    %>
    </TABLE>
    </BODY>
    </HTML>

    Since the HTML is interpreted on the client side the browser would be looking for the image on the user's local hard drive Z:/ (although probably not because the correct syntax would be file:// etc). You need to make the image paths relative to the root of your web server (eg: src="/images/myimage.gif"). If the images are not already available in a folder under your web server root you will need to make them so.
    Ben

  • Pagination  using Struts and jsp

    Hi ,
    I am newer to this forum. I want pagination example using struts. plz help me

    [_Pagination + Struts_|http://www.google.com/search?hl=en&q=pagination+struts&meta=]

Maybe you are looking for

  • Not able to clear out a formula field value when variables are equal to 0

    I am trying to calculate the difference between a formula field from a main report and a formula field from a subreport. When i run the report i get a correct difference calculation only when both formula fields have a value different than 0. When bo

  • Strange lines when exporting from Illustrator

    I am having an issue that's driving me crazy, I've tried everything and I still can't figure out why it's doing this. I created a template in Illustrator,  very basic,  just some 1 inch circles.   The goal is to color them in different color palettes

  • Render to HD compatible Apple TV format

    I bought the Apple TV to watch my movies that I created using the Sony HD camera and Sony Vegas video editing software. Does anyone know what format to save or render the movies to in order to playback using the HD capabilities of the Apple TV? I can

  • Problems with AirDisplay unistall

    Hello, My names Luis from Argentina. I installed AirDisplay for using the iPad as a second monitor. When I rebooted the mac,  started with a blue screen and  the started of the mac is more  slow. I Inistalled the AirDisplay, but the blue screen conti

  • Out of memory when reading USER_SDO_GEOM_METADATA

    Hi, I'm running a plsql procedure from sqldeveloper against a Oracle10g (Spatial) server. The procedure mainly performs a SDO_NN search. I was expecting the procedure processing time to be about 48h (due to the huge tables involved) But I always get