Using jasper with web application in .war file

2004-05-12 Thread Dennis Thrysøe
Hi,

I'm trying to figure out whether jasper can be used with a web 
application that's still in it's war file (unexploded)?

A classpath for jasper can be specified, but it seems that only direct 
filenames can be specified here and not - for instance - a jar URL.

Any suggestions for using jasper without unpacking the web application 
are welcome.

TIA,

-dennis

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


JSP Include and URL encoding

2004-04-02 Thread Dennis Thrysøe
Hi,

I'm having problems including a JSP page from another JSP page using 
parameters with special characters.

I looked through the archives, but couldn't find anything about this issue.

I can encode a string, and the result is correct

  URLEncoder.encode(blåbærgrød, ISO-8859-1)

But if I make an include with the same value

  jsp:include page=bar.jsp flush=true
jsp:param name=word value=blåbærgrød /
  /jsp:include
The special characters are replaced with question marks '?' (%3F). So 
the query string seen from bar.jsp becomes

  word=bl%3Fb%3Frgr%3Fd

In fact the generated java code for the main jsp file contains this 
string also. So the problem is already during parsing or servlet generation.

The requests character encoding is null. The page directive's 
pageEncoding attribute is ISO-8859-1 (or not present - doesn't make a 
difference.

The user properties user.country and user.language are 'US' and 'en' 
respectively. Might that be the cause?

The problem is on Tomcat 4.1.29 on Linux.

By the way: I still haven't figured out whether Tomcat 4.1.30 is 
supposed to be able to run on JDK 1.3.1.

Any help appreciated,

-dennis

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JSP Include and URL encoding

2004-04-02 Thread Dennis Thrysøe
Hiroshi Iwatani wrote:
(1)Set page directive attributes right
   (Maybe, pageEncoding = your platform encoding and charset = UTF-8)
They are correct. The generated servlet already contains the wrong value 
'%3F'.

(2)Use a Servlet/JSP container other than Tomcat. For example, Resin
from caucho.com.
I guess that could be an option, but this Tomcat instance is running at 
our service provider, so they would have to think so too.

The problem has now been fixed by setting the language and country 
properties to 'da' and 'DK' respectively. This was apparently necesarry 
for the JSP parser to read the file correctly.

quote
Scott Ferguson wrote:
  Actually, the underlying problem is a difficult one. Unfortunately, URLs
  don't have an official character encoding. It looks like we're drifting
  toward UTF-8 as a default, but that's not specified in the HTTP
  specifications.
 
  Because the HTTP request does not specify the URL encoding, the web
  server needs to guess. It's somewhat of an ugly problem.
For JSP includes this doesn't seem to be the problem. It is because of 
characters being replaced with '?' when reading the JSP.

Thanks anyway,

-dennis

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JSP Include and URL encoding

2004-04-02 Thread Dennis Thrysøe
Veniamin Fichin wrote:
Dennis Thrysøe wrote:

Hi,

I'm having problems including a JSP page from another JSP page using 
parameters with special characters.

I looked through the archives, but couldn't find anything about this 
issue.
   Try this URL: http://issues.apache.org/bugzilla/show_bug.cgi?id=23929 
. Connector attributes mentioned there available since 5.0.19, as I 
understand.
Thanks, that may be related. Perhaps it could override the VM's language 
properties. But we fixed it by changing those properties instead.

Besides the problem was on 4.1.29.

-dennis

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JSP problems

2004-04-01 Thread Dennis Thrysøe
Dennis Thrysøe wrote:
Dennis Thrysøe wrote:
Nope. Just plain old JSP's in a webapp. Jasper generates servlets and 
compiles them just fine. But it cannot load them. I get

java.lang.ClassNotFoundException: org.apache.jsp.index_jsp


I'm still having the problem. Is there anybody out there with a really 
detailed knowledge of how Jasper uses it's temp-dir?
It seems that I just found a workaround for the issue: Use JDK 1.4.2 
instead of JDK 1.3.1.

Shouldn't TOmcat 4.1.30 be able to run on JDK 1.3.1?

-dennis

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


JSP problems

2004-03-31 Thread Dennis Thrysøe
Hi,

I'm still having the problem I already wrote about, as a result of 
upgrading a tomcat 4.0.1 installation to 4.1.30.

I get a ClassNotFoundException for the generated JSP class. The 
generated classes are written to the context work directory with the 
same nameing and structure as the JSPs in the webapp. But the classes 
are declared in the package org.apache.jsp.

Any ideas, how I can make tomcat (jasper?) load the classes that it just 
generated and then compiled?

Thanks,

-dennis

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JSP problems

2004-03-31 Thread Dennis Thrysøe
QM wrote:
: [snip] the classes are declared in the package org.apache.jsp.
: 
: Any ideas, how I can make tomcat (jasper?) load the classes that it just 
: generated and then compiled?

So then, you're precompiling the JSPs?
Nope. Just plain old JSP's in a webapp. Jasper generates servlets and 
compiles them just fine. But it cannot load them. I get

java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
	at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:209)
	at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:131)
	at 
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:497)
	at 
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:150)
	at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:195)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

I don't have any URLs -- do a web search -- but there are examples for
building the JSPs into WEB-INF/classes and having Ant create the servlet
mappings (for web.xml) for you.
I wish that was the problem :)

-dennis

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JSP problems

2004-03-31 Thread Dennis Thrysøe
Dennis Thrysøe wrote:
QM wrote:

: [snip] the classes are declared in the package org.apache.jsp.
: : Any ideas, how I can make tomcat (jasper?) load the classes that 
it just : generated and then compiled?

So then, you're precompiling the JSPs?
Nope. Just plain old JSP's in a webapp. Jasper generates servlets and 
compiles them just fine. But it cannot load them. I get

java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
I'm still having the problem. Is there anybody out there with a really 
detailed knowledge of how Jasper uses it's temp-dir?

What I experience is that Jasper compiles

  webapp/foo/index.jsp

into

  work/foo/index_jsp.class (which contains org.apache.jsp.index_jsp)

But Jasper's classloader doesn't seem able to load the file. Actually I 
see two problems here:

1) How can the classloader load a class in the org.apache.jsp package if 
the org/apache/jsp directory structure isn't present. Should this work?

2) What would the fully qualified classname of for instance 
webapp/bar/index.jsp be?

Thanks,

-dennis

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Upgrading from 4.0.1 to 4.1.30

2004-03-29 Thread Dennis Thrysøe
Hi,

I'm having problems with upgrading an existing environment from Tomcat 
4.0.1 to 4.1.30.

I just tried running the new version with the existing configuration 
(attached). But whenever I request a JSP I get an error like this:

java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
	at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:209)
	at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:131)
	at 
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:497)
	at 
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:150)
	at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:195)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

The class is generated and compiled fine, and placed in the context's 
work-dir (placed similarly to the JSP file in the webapp).

I've run out of things to try. Any ideas?

-dennis
?xml version=1.0 encoding=ISO-8859-1?

Server port=8005 shutdown=SHUTDOWN debug=0

  Service name=Tomcat-Standalone

Connector className=org.apache.catalina.connector.http.HttpConnector
  port=80
  minProcessors=5
  maxProcessors=75
  enableLookups=false
  redirectPort=8443
  acceptCount=10
  connectionTimeout=6
  debug=0/

Connector className=org.apache.catalina.connector.http.HttpConnector
  port=81
  minProcessors=5
  maxProcessors=75
  enableLookups=false
  redirectPort=8443
  acceptCount=10
  connectionTimeout=6
  debug=0/

Connector className=org.apache.catalina.connector.http.HttpConnector
  port=443
  minProcessors=5
  maxProcessors=75
  enableLookups=false
  acceptCount=10
  scheme=https
  secure=true
  debug=0

  Factory className=org.apache.catalina.net.SSLServerSocketFactory
	clientAuth=false
	keystoreFile=conf/test.keystore
	keystorePass=badeand
	protocol=TLS/
/Connector

Engine name=Standalone defaultHost=localhost debug=0

  Logger className=org.apache.catalina.logger.FileLogger
	directory=C:\cvs\cmd31\core/../build/tomcat/log
	prefix=catalina_log.
	suffix=.txt
	timestamp=true/

  Host name=localhost appBase=C:\cvs\cmd31\core/../build/webapp unpackWARs=false debug=0 autoDeploy=true
Valve className=org.apache.catalina.valves.AccessLogValve
  directory=C:\cvs\cmd31\core/../build/tomcat/log
  prefix=localhost_access_log.
  suffix=.txt
  pattern=common/

Logger className=org.apache.catalina.logger.FileLogger
  directory=C:\cvs\cmd31\core/../build/tomcat/log
  prefix=localhost_log.
  suffix=.txt
  timestamp=true/

Context
  path=
  docBase=
  workDir=C:\cvs\cmd31\core/../build/tomcat/work
  reloadable=true
  debug=0

  Manager className=org.apache.catalina.session.StandardManager
pathname=C:\cvs\cmd31\core/../build/tomcat/log/SESSION.ser/

/Context

  /Host

/Engine

  /Service

/Server
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
 PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
web-app

  !--  Introduction == --
  !-- This document defines default values for *all* web applications  --
  !-- loaded into this instance of Tomcat.  As each application is --
  !-- deployed, this file is processed, followed by the--
  !-- /WEB-INF/web.xml deployment descriptor from your own   --
  !-- applications.--
  !--  --
  !-- WARNING:  Do not configure application-specific resources here!  --
  !-- They should go in the /WEB-INF/web.xml file in your application.   --


  !-- == Built In Servlet Definitions  --


  !-- The default servlet for all web applications, that serves static --
  !-- resources.  It processes all requests that are not mapped to other   --
  !-- servlets with servlet mappings (defined either here or in your own   --
  !-- web.xml file.  This servlet supports the following initialization--
  !-- parameters (default values are in square brackets):  --
  !--  --
  !--   debug   Debugging detail level for messages logged --
  !--   by this servlet.  [0]  --
  !--  --
  !--   input   Input buffer size (in bytes) when reading  --
  !--   resources to be served.  [2048]--
  !--  

Re: Vedr.: Upgrading from 4.0.1 to 4.1.30

2004-03-29 Thread Dennis Thrysøe
Thomas Nybro Bolding wrote:
Hi Dennis,
this is just a wild guess but are your classes placed in packages? As I 
recall at some point around 4.0x this became a prerequisite.
I'm unsure which classes your are speaking of. The generated class in 
this case is org.apache.jsp.index_jsp, but it is not placed in the 
package (folder) org/apache/jsp. Instead it's placed in the same folder 
as the JSP in the webapp.

I can see how this is a problem, if the webapp classloader isn't 
implemented in an unusually creative way. But I don't know how to alter 
this behaviour.

-dennis

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]