|
|
Subject: Re: Re: JSTL1.0 and resin - msg#00181
List: text.xml.resin.user
Hmm. All I can offer is that it is related to your XML parsers. I had
problems with this for months. Once I finally switched EVERYTHING to use
the apache commons XML package, things started working.
Have you tried the JSTL example webapp?
On Thu, 19 Feb 2004, johnborg@xxxxxxxxxxxxx wrote:
>
> I tried with xml-apis.jar but that didn't work either. For my web app, I am
> using jdom.jar and xerces.jar - though, I don't think either of them should
> cause a problem.
>
>
>
> >
> > From: John York <jry@xxxxxxxxxxxxxx>
> > Date: 2004/02/19 Thu AM 09:45:00 EST
> > To: "resin-interest@xxxxxxxxxx" <resin-interest@xxxxxxxxxx>
> > Subject: Re: Re: JSTL1.0 and resin
> >
> > We use jpackage.org for most of our java-related packages.
> > xml-commons-apis was pulled from them, but the code from
> > http://xml.apache.org/commons/ should work as well, since that is what
> > the jpackage.org version is based on. The trick was removing
> > the other XML packages that aren't needed...sax.jar, dom.jar, etc.
> >
> > You may need to use this package in your applications as well so as to
> > avoid any other conflicts you might have with the resin classloader.
> >
> > John
> >
> >
> > On Thu, 19 Feb 2004, johnborg@xxxxxxxxxxxxx wrote:
> >
> > > Where can I find this xml-commons-api.jar? Is it the same as XML-commons
> > > package at Apache (http://xml.apache.org/commons/)? I tried with Apaches
> > > xml-apis.jar, without much luck.
> > >
> > > Thanks!
> > >
> > >
> > > >
> > > > From: John York <jry@xxxxxxxxxxxxxx>
> > > > Date: 2004/02/18 Wed PM 10:31:28 EST
> > > > To: resin-interest@xxxxxxxxxx
> > > > Subject: Re: JSTL1.0 and resin
> > > >
> > > > I was having the same problem a while back, this will probably help you
> > > > out.
> > > >
> > > > http://www.caucho.com/support/resin-interest/0401/0185.html
> > > >
> > > >
> > > > johnborg@xxxxxxxxxxxxx wrote:
> > > >
> > > > >I am trying to use Jakarta taglib - JSTL1.0 (with Caucho resin 2.1.1),
> > > > >but
> > > > >getting following error in my JSP page:
> > > > >
> > > > >org.xml.sax.SAXParseException: The prefix "jsp" for
> > > > >element "jsp:root" is not bound
> > > > >
> > > > >I was wondering if anyone has seen it before..
> > > > >
> > > > >We are using older version of Resin (2.1.1), which doesn't have
> > > > >built-in JSTL support.
> > > > >
> > > > >Thanks,
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> > --
> > John York
> > Software Engineer
> > CareerSite Corporation
> >
> >
>
>
--
John York
Software Engineer
CareerSite Corporation
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: Re: JSTL1.0 and resin
I tried with xml-apis.jar but that didn't work either. For my web app, I am
using jdom.jar and xerces.jar - though, I don't think either of them should
cause a problem.
>
> From: John York <jry@xxxxxxxxxxxxxx>
> Date: 2004/02/19 Thu AM 09:45:00 EST
> To: "resin-interest@xxxxxxxxxx" <resin-interest@xxxxxxxxxx>
> Subject: Re: Re: JSTL1.0 and resin
>
> We use jpackage.org for most of our java-related packages.
> xml-commons-apis was pulled from them, but the code from
> http://xml.apache.org/commons/ should work as well, since that is what
> the jpackage.org version is based on. The trick was removing
> the other XML packages that aren't needed...sax.jar, dom.jar, etc.
>
> You may need to use this package in your applications as well so as to
> avoid any other conflicts you might have with the resin classloader.
>
> John
>
>
> On Thu, 19 Feb 2004, johnborg@xxxxxxxxxxxxx wrote:
>
> > Where can I find this xml-commons-api.jar? Is it the same as XML-commons
> > package at Apache (http://xml.apache.org/commons/)? I tried with Apaches
> > xml-apis.jar, without much luck.
> >
> > Thanks!
> >
> >
> > >
> > > From: John York <jry@xxxxxxxxxxxxxx>
> > > Date: 2004/02/18 Wed PM 10:31:28 EST
> > > To: resin-interest@xxxxxxxxxx
> > > Subject: Re: JSTL1.0 and resin
> > >
> > > I was having the same problem a while back, this will probably help you
> > > out.
> > >
> > > http://www.caucho.com/support/resin-interest/0401/0185.html
> > >
> > >
> > > johnborg@xxxxxxxxxxxxx wrote:
> > >
> > > >I am trying to use Jakarta taglib - JSTL1.0 (with Caucho resin 2.1.1),
> > > >but
> > > >getting following error in my JSP page:
> > > >
> > > >org.xml.sax.SAXParseException: The prefix "jsp" for
> > > >element "jsp:root" is not bound
> > > >
> > > >I was wondering if anyone has seen it before..
> > > >
> > > >We are using older version of Resin (2.1.1), which doesn't have built-in
> > > >JSTL support.
> > > >
> > > >Thanks,
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
> --
> John York
> Software Engineer
> CareerSite Corporation
>
>
Next Message by Date:
click to view message preview
RE: Multiple Authenticators
Thanks Guys,
Sorry, I don't think I explained my problem properly.
Ok, my application presently uses JDBCAuthenticator to restrict access
to customer account section with a mapping of "/customer/account/*"
under the role "admin". My business logic updates the database upon
creation of a new customer so my use of the JDBCAuthenticator is
coulpled with my appliactions DB.
Now I have to place this app on a public password protected server and I
require protecting all the resouces with a mapping of "/*".
I started to try and implement this by just adding a new
security-constraint with the blanket mapping of "/*" with the role
"user" so my web.xml looks like the following:
<!-- Container managed security -->
<login-config auth-method='Form'>
<form-login-config form-login-page='/login.wac' form-error-
page='/login.wac?code=0'/>
<authenticator id='com.caucho.http.security.JdbcAuthenticator'>
<pool-name>appOutlet</pool-name>
<password-query>
SELECT password FROM accounts WHERE
user_name=?
</password-query>
<role-query>
SELECT role FROM accounts WHERE user_name=?
</role-query>
</authenticator>
</login-config>
<security-constraint>
<web-resource-collection>
<url-pattern>/customer/account/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description>ADMIN</description>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint >
<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description>view</description>
<role-name>user</role-name>
</auth-constraint>
</security-constraint >
This should be easy enough but when I go to my login page I have to
inform resin of the j_uri and it is different depending on what user is
loggin in and I am not sure how to determine what client is logging in
so I can set the j_uri appropriatly as the "user" does not want into the
account area. My login form is as follows:
<form name="loginForm" action='<%=
response.encodeURL("j_security_check")%>' method='POST'>
<input type='hidden' name='j_uri'
value='/customer/account.wac'/>
<input type="text" name='j_username' />
<input type="text" name='j_password' />
</form>
How do I implement this? How can I determine in the login page what user
is logging in so I can set the j_uri. I know I could build a dispatch
servlet that would direct the user depending on there account role but I
don't want this minor change to force change in my apps logic as it will
be removed shortly.
Many thanks,
Greg
> -----Original Message-----
> From: owner-resin-interest@xxxxxxxxxx [mailto:owner-resin-
> interest@xxxxxxxxxx] On Behalf Of Martin Cordova
> Sent: Thursday, February 19, 2004 1:38 PM
> To: resin-interest@xxxxxxxxxx
> Subject: Re: Multiple Authenticators
>
> I assume that the problem is that you have to use the same server for
demo
> and production? otherwise I don't see the problem. Just create a
second
> copy of the application, you may use a different context name or a
> different host. Change web.xml to use the XMLAuthenticator in the new
demo
> app. I don' think that you can configure a single app to use two
different
> authenticators depending on the origin of the request. You could write
an
> authenticator that executes the login against different backends based
on
> request properties.
>
> Regards,
> Martin
> -----
> Dinamica Framework for J2EE
> Free, Simple and Powerful
> http://www.martincordova.com
>
>
>
> > Hi All,
> >
> > I would like to have multiple Authenticators configured in
Resin2.1.2.
> > My application is currently configured in the web.xml to use the
> > JDBCAuthenticator and is working great. I have to set up a public
> > password protected server to demo the app and I would like to just
use
> > the XMLAuthenticator with the basic login method so I don't have to
> > alter my DB to accommodate this temporary constraint.
> >
> > Is there any way I can do this?
> >
> > Many thanks,
> >
> >
> > Greg Hess
> >
> > Software Engineer
> >
> > Wrapped Apps Corporation
> >
> > 275 Michael Cowpland Dr.
> >
> > Suite 201
> >
> > Ottawa, Ontario
> >
> > K2M 2G2
> >
> > Tel: (613) 591 -7552
> >
> > Fax: (613) 591-0523
> >
> > 1 (877) 388-6742
> >
> > www.wrappedapps.com
> >
> > <http://www.wrappedapps.com>
> >
>
>
Previous Message by Thread:
click to view message preview
Re: Re: JSTL1.0 and resin
I tried with xml-apis.jar but that didn't work either. For my web app, I am
using jdom.jar and xerces.jar - though, I don't think either of them should
cause a problem.
>
> From: John York <jry@xxxxxxxxxxxxxx>
> Date: 2004/02/19 Thu AM 09:45:00 EST
> To: "resin-interest@xxxxxxxxxx" <resin-interest@xxxxxxxxxx>
> Subject: Re: Re: JSTL1.0 and resin
>
> We use jpackage.org for most of our java-related packages.
> xml-commons-apis was pulled from them, but the code from
> http://xml.apache.org/commons/ should work as well, since that is what
> the jpackage.org version is based on. The trick was removing
> the other XML packages that aren't needed...sax.jar, dom.jar, etc.
>
> You may need to use this package in your applications as well so as to
> avoid any other conflicts you might have with the resin classloader.
>
> John
>
>
> On Thu, 19 Feb 2004, johnborg@xxxxxxxxxxxxx wrote:
>
> > Where can I find this xml-commons-api.jar? Is it the same as XML-commons
> > package at Apache (http://xml.apache.org/commons/)? I tried with Apaches
> > xml-apis.jar, without much luck.
> >
> > Thanks!
> >
> >
> > >
> > > From: John York <jry@xxxxxxxxxxxxxx>
> > > Date: 2004/02/18 Wed PM 10:31:28 EST
> > > To: resin-interest@xxxxxxxxxx
> > > Subject: Re: JSTL1.0 and resin
> > >
> > > I was having the same problem a while back, this will probably help you
> > > out.
> > >
> > > http://www.caucho.com/support/resin-interest/0401/0185.html
> > >
> > >
> > > johnborg@xxxxxxxxxxxxx wrote:
> > >
> > > >I am trying to use Jakarta taglib - JSTL1.0 (with Caucho resin 2.1.1),
> > > >but
> > > >getting following error in my JSP page:
> > > >
> > > >org.xml.sax.SAXParseException: The prefix "jsp" for
> > > >element "jsp:root" is not bound
> > > >
> > > >I was wondering if anyone has seen it before..
> > > >
> > > >We are using older version of Resin (2.1.1), which doesn't have built-in
> > > >JSTL support.
> > > >
> > > >Thanks,
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
> --
> John York
> Software Engineer
> CareerSite Corporation
>
>
Next Message by Thread:
click to view message preview
sending a large file
Hi,
I'm trying to send a large file to the client. At first, I was reading
a file into a byte array, then writing that byte array to the output
stream. This worked fine, except that it required a lot of memory
every time it was run (the file sizes are in the 150-200 MB range, so
resin would grab 150-200MB of ram every time the file was sent).
Is there some way of doing this without loading the entire file into
memory? I tried reading pieces of the file into memory, then writing
each piece to the output stream, but it would always quit after the
first piece:
int chunkSize = 1000000;
File theFile = new File("/foo/bar/thing.zip");
int fileLength = (int)theFile.length();
int chunks = fileLength/chunkSize;
int remainder = fileLength%chunkSize;
response.setContentLength(fileLength);
byte byteBuffer[] = new byte[chunkSize];
byte remainderBuffer[] = new byte [remainder];
fis = new FileInputStream("/foo/bar/thing.zip");
for (int i=0; i<chunks; i++) {
if
(fis.read(byteBuffer,(i*chunkSize),((i+1)*chunkSize))!=-1) {
response.getOutputStream().write(byteBuffer);
}
}
while
(fis.read(remainderBuffer,chunks*chunkSize,fileLength)!=-1) {
response.getOutputStream().write(remainderBuffer);
}
Is there any way I can keep the output stream open for further chunks
of data? Or is there an easier way to pipe a large file through to the
client?
Thanks,
Dylan.
|
|