Re: Precompiled jsp's

2001-10-25 Thread Oskar Zinger

need to do servlet and servlet-mapping tags in your web.xml filr for
each jsp

Thys De Wet (ZA) wrote:

 Ok so I got my  JSP's compiled into class files..
 Placed them in /WEB-INF/classes..
 Now how do I tell Tomcat 3.2.3 to use these class files ...

 ANy help

 PLEASE ..

 *begs on knees*

 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.

 This footnote also confirms that this email message has been swept by
 MIMEsweeper for the presence of computer viruses.

 www.mimesweeper.com
 **




Re: jsp and tomcat 4

2001-07-17 Thread Oskar Zinger

You need to make changes to a jsp file, not java file.  Tomcat will detect
changes automatically and will translate jsps into java files and then compile
them.
---
Oskar

Marco Magistrali wrote:

 Hi,

 I have a question:
 if I modify a JSP under tomcat4 i don't see any change in browser because
 tomcat4 get the .class of JSP in cache (directory work)

 How can I say to recompile the jsp if there are changes in java??

 tanks
 Marco




Re: Precompiled JSPs

2001-07-12 Thread Oskar Zinger

Hi Uri,
You have to compile your JSPs with -webxml and -webapp options.  This
option will create a web.xml file with all the required servlet mapping
and everything will work fine.

I ran such command:
jspc.sh -p package name -dd directory there to output translate java
files -webxml path where to store a web.xml file (i.e. /temp/web.xml)
-webapp directory of your webapp where all the JSPs reside

After the web.xml file is produced you have incorporate it with your
tomcat original web.xml file.

Or you could create a servlet mapping for your jsps manually.  In the
following way:
servlet
   servlet-namecom.somecompany.pacakge.SomeJsp/servlet-name
   servlet-classcom.somecompany.pacakge.SomeJsp/servlet-class
servlet
.
.  you need to put all servlet tags first (for each jsp)
.  then servlet-mapping tags go (for each jsp)
.
servlet-mapping
   servlet-namecom.somecompany.pacakge.SomeJsp/servlet-name
   url-pattern/SomeJsp.jsp/url-pattern
/servlet-mapping

This way you do not need to change urls in your original JSPs to class
names, you can just use the same urls in your JSPs and pre-compiled JSPs.

Hope this helps,
Oskar

Uri Cohen wrote:

 I precompiled all my JSPs in the application, using jspc. Most pages
 work OK, but there are some pages which don't. For some reason, when
 loading these pages the session is lost, causing many errors. I solved
 the problem by sending the request parameter JSESSIONID when calling
 these pages.
 These pages worked fine as regular JSPs, and this symptom only occures
 when I use them as servlets.
 Has anyone encountered such a problem?




Re: jspc and deployment

2001-06-12 Thread Oskar Zinger

Thanks. I got it to work.
Oskar

Sophie wrote:

 Hi Oskar,

 I am using the options:
 -uriroot /$TOMCAT_HOME/webapps/AppName
 -d /$TOMCAT_HOME/webapps/AppName/WEB-INF/classes
 to set the directory where the results of jspc should be placed
 -webxml/OWN_DIR/webAppName.xml
 -webapp/$TOMCAT_HOME/webapps/AppName
 to specify the directory that contains the jsp's

 I remove the jsp's after running jspc from /$TOMCAT_HOME/webapps/AppName.

 After running jspc, you should run javac to compile the generated java-files to
 class files.

 I update my own web.xml with the results of /$OWN_DIR/webAppName.xml,
 and then everything runs fine.

 Hope this help,

 Sophie

 Oskar Zinger schreef:

  What option did you use with jspc?  I am encountering the same problem.
  Thanks
  Oskar
 
  FRED wrote:
 
   Hi Randy,
  
   Thank you for your reaction. I got it working. This will save me a lot
   of time and will make my application more scalable.
  
   Sophie
  
   Randy Layman schreef:
  
The answer is you can't.  Even if you could get it to generate the
file names correctly, Tomcat still wouldn't use them.  What you need to do
is to use jspc with the option that produces a web.xml file.  You then need
to incorporate that with your web.xml file, compile the .java files, and you
will have a webapp made up of exclusively servlets (and static content) - no
more JSP to compile.
   
Randy
   
 -Original Message-
 From: Joost en Sooophie [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, June 09, 2001 1:59 PM
 To: [EMAIL PROTECTED]
 Subject: jspc and deployment


 Hi,

 My problem is the following:

 I am working on an EJB application. I want to pre-compile all the
 jsp-pages before making the application available on the internet
 (and someone clicking on the page, experiencing quite some delay).

 When the jsp MyJSP.jsp is compiled with jspc in Tomcat, files
 MyJSP.java
 and MyJSP.class are placed in the /TOMCAT_HOME/work directory. But
 when I start the application on the internet, it creates the files
 xxxMy_yyyJSP.java
 and xxxMy_yyyJSP.class in the /TOMCAT_HOME/work directory.

 How can I configure jspc, so that it creates the files
 xxxMy_yyyJSP.java and
 xxxMy_yyyJSP.class in the /TOMCAT_HOME/work directory?

 Any answer or information or documentation is much appreciated.

 Sophie






Re: jspc and deployment

2001-06-11 Thread Oskar Zinger

What option did you use with jspc?  I am encountering the same problem.
Thanks
Oskar

FRED wrote:

 Hi Randy,

 Thank you for your reaction. I got it working. This will save me a lot
 of time and will make my application more scalable.

 Sophie

 Randy Layman schreef:

  The answer is you can't.  Even if you could get it to generate the
  file names correctly, Tomcat still wouldn't use them.  What you need to do
  is to use jspc with the option that produces a web.xml file.  You then need
  to incorporate that with your web.xml file, compile the .java files, and you
  will have a webapp made up of exclusively servlets (and static content) - no
  more JSP to compile.
 
  Randy
 
   -Original Message-
   From: Joost en Sooophie [mailto:[EMAIL PROTECTED]]
   Sent: Saturday, June 09, 2001 1:59 PM
   To: [EMAIL PROTECTED]
   Subject: jspc and deployment
  
  
   Hi,
  
   My problem is the following:
  
   I am working on an EJB application. I want to pre-compile all the
   jsp-pages before making the application available on the internet
   (and someone clicking on the page, experiencing quite some delay).
  
   When the jsp MyJSP.jsp is compiled with jspc in Tomcat, files
   MyJSP.java
   and MyJSP.class are placed in the /TOMCAT_HOME/work directory. But
   when I start the application on the internet, it creates the files
   xxxMy_yyyJSP.java
   and xxxMy_yyyJSP.class in the /TOMCAT_HOME/work directory.
  
   How can I configure jspc, so that it creates the files
   xxxMy_yyyJSP.java and
   xxxMy_yyyJSP.class in the /TOMCAT_HOME/work directory?
  
   Any answer or information or documentation is much appreciated.
  
   Sophie
  
  




Re: JSP Print Error

2001-06-04 Thread Oskar Zinger

Hi,

% out.write(some text); %

This should work.
Oskar Zinger

Mike Alba wrote:

 Hi,   I had a JSP running that was using a % out.println(Some
 text); % But now when I try to run it I am gettinga HTTP 500
 errorand the output is No method patching print() found in class
 javax.servlet.jsp.JspWriter. out.print( ); Any suggestions? Thanks so
 much for your help! Mike




get/setAttribute and getParameter...

2001-06-02 Thread Oskar Zinger

Hi,
What is more time consuming?

JSP1:
% request.setAttribute(FLAG, new Boolean(true)); %
jsp:include page=JSP2.jsp flush=true/

JSP2:
% boolean FLAG = ((Boolean)
request.getAttribute(FLAG)).booleanValue();
 if (FLAG) {
   ..
   ...
 }
%

OR?:

JSP1:
jsp:include page=JSP2.jsp?FLAG=true flush=true/

JSP2:
% String FLAG = request.getParameter(FLAG);
  if (FLAG.equals('true)) {
 ..
 ..
  }
%

OR?:

JSP1:
jsp:include page=JSP2.jsp?FLAG=true flush=true/

JSP2:
% boolean FLAG = (new
Boolean(request.getParameter(FLAG))).booleanValue();
  if (FLAG) {
 ..
 ..
  }
%


AND, which way is it best practiced.

Thankss for any help!
--
Oskar Zinger




Re: Free MS SQL JDBC driver??

2001-05-31 Thread Oskar Zinger

go to www.freetds.org

---
Oskar

bryan wrote:

 Hello all,

 Does anybody know if there is free MS SQL 7.0/ 2000
 JDBC (Type 4) driver?

 Thanks
 Bryan




jsp:include page=%=servletPath% flush=true|false/ errors

2001-05-18 Thread Oskar Zinger

Hey, guys,
I am new to tomcat... using Tomcat v4.0-b3/b5.

I am trying to include other jsps output in one main jsp and getting an
IllegalStateException: with error message:

Cannot forward after response has been committed.

This is what I am doing:

% for(int i = 0; i  typeNames.length; i++) {
url = my url is constructed here; %
jsp:include page=%=url% flush=true  // if I set the
flush to false I see the first iterated page of the servlet that I am
including, if I am setting it to true then I get exception right on the
first iteration of the loop.
 % } %

I am writing JSPs then I am compiling them into servlets by using
jspc.sh script that uses JspC.java in jasper's package.  So when I go
into the browser I am accessing not JSPs but converted jsps to Servlets
which were generated by this script. (jspc.sh).

I have tried many different things already, setting isThreadSafe to
FALSE, setting buffer to a very big size, setting autoFlush to TRUE and
FALSE, nothing seems to work.

Has anyone ever encountered such problems?

Thanks for your help,
Oskar