× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: Having trouble with a JSP compile
  • From: David Gibbs <dgibbs@xxxxxxxxxxxxxxx>
  • Date: Mon, 27 Nov 2000 16:06:36 -0600

Title: RE: Having trouble with a JSP compile

> I keep getting the following error when I try to run this JSP   ""
> com.sun.jsp.JspException: Compilation failed""  I included the code
> hopefully I am missing something simple. I have changed the
> system name and
> the userid and password fields. I was wondering if there might be an
> authority issue.  I am using WebSphere 3.02.2 on an AS/400 V4R5...
> Thanks in advance.

I'm not too familiar with websphere, but do you have your java compile command defined?  The weblogic app server (which I am familiar with) requires you to tell it the command line to execute to compile the generated java source into class files.

> <%@ page import="java.sql.*"%>
> <%! Connection con = null;%>
> <%! String system = "AS/400/LIB"; %>
> <%! String userId = "USERID"; %>
> <%! String password = "PASSWORD"; %>
> <%! String url = "jdbc:db2://" + system; %>
>
> <%! public Connection getConnection() {
>    if(con != null) (return con;)
>       try {
>            Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
<snip snip snip>

Can I suggest that you try and separate your logic from your presentation?  Create another class that contains all the logic required to retrieve the data & massage it (along with methods to deliver the data to those that might inquire).  Then in your JSP, import the necessary hierarchy, and call the appropriate methods to retrieve the data and display it.

david


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.