Find login information from tomcat security

2005-04-18 Thread Gia Thornton
Hi,
   I am using Form-based tomcat security.  I use a servlet to find login 
information such as the principal name, all the role names for this principal.  
I can use request.getUserPrincipal() from
javax.servlet.http.HttpServletRequest.  Is there anyway I can use 
GenericPrincipal class from package org.apache.catalina.realm of Tomcat in 
servlet?  Thank you for your help.
 
 
regards,




-
Yahoo! Mail Mobile
 Take Yahoo! Mail with you! Check email on your mobile phone.

Write file to browser tomcat error

2005-03-02 Thread Gia Thornton
Hi,
I am using the code below in a jsp to write a jar file to the browser so that 
user can download it. However, after the user hit download to save the file, 
the tomcat server display an error caused by flushing the buffer. Does anyone 
know why it happens? Thank you for your help

---
try{
String disHeader = Attachment;Filename=\ + jarName +\;
response.setHeader(Content-Disposition, disHeader);
response.setContentType(APPLICATION/OCTET-STREAM); 

FileInputStream fileInputStream = new FileInputStream(jarFile);

int i;
while ((i=fileInputStream.read())!=-1)
{
out.write(i);
}
fileInputStream.close();
out.close(); //This line gives the problem
}

catch(Exception e) // file IO errors
{
System.out.println(# file error);
e.printStackTrace();
}


error:

org.apache.jasper.runtime.PageContext: Internal error flushing the buffer in 
release() 


-
Celebrate Yahoo!'s 10th Birthday! 
 Yahoo! Netrospective: 100 Moments of the Web 

Re: Basic Authentication Window

2005-01-28 Thread Gia Thornton
Hi Larry,
   Thank you for your reply!  Yes, I have tried the form authentication.  It 
does redirect to the login page when session expires.
 
 
Gia

Larry Meadors [EMAIL PROTECTED] wrote:
If you are using basic authentication, that is out of your control -
the browser will resend the authentication with every request. I does
not care at all about your session.

I think your simplest solution is to switch to form-based authentication.

Larry

On Thu, 27 Jan 2005 19:58:16 -0800 (PST), Gia Thornton
wrote:
 Hi,
 I am using Tomcat Container managed security: Basic Authentication by adding 
 the following to web.xml.
 
 
 
 The Entire Web Application
 /XMLServlet
 
 
 tomcat
 
 
 
 BASIC
 UserDatabase
 
 
 
 An example role defined in conf/tomcat-users.xml
 
 tomcat
 
 
 -
 I have used a form in my jsp:
 
 
  [input] 
  [input] 
  [input] 
 
 
 If I click on Edit button, the javascript checkLogin will submit the form. 
 If the user has not logged in, an authentication window will pop up. After 
 the first-time authentication, the page is directed to the same page 
 containing the above form. I intentionally set setMaxInactiveInterval to be 
 like 10 seconds in XMLServlet. When the session expires, I click the Edit 
 button again, now the page directly go to XMLServlet without the 
 authentication window poped up.
 
 Does anyone know what causes this? How can I get the authentication window 
 pop up when the session expires? Thank you for your help.
 
 
 Gia
 
 
 -
 Do you Yahoo!?
 Yahoo! Search presents - Jib Jab's 'Second Term'


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


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Basic Authentication Window

2005-01-27 Thread Gia Thornton
Hi,
   I am using Tomcat Container managed security: Basic Authentication by adding 
the following to web.xml.
 

  security-constraint
web-resource-collection
  web-resource-nameThe Entire Web Application/web-resource-name
  url-pattern/XMLServlet/url-pattern
/web-resource-collection
auth-constraint
  role-nametomcat/role-name
/auth-constraint
  /security-constraint
 login-config
auth-methodBASIC/auth-method
realm-nameUserDatabase/realm-name
  /login-config
  security-role
description
  An example role defined in conf/tomcat-users.xml
/description
role-nametomcat/role-name
  /security-role
 
-
I have used a form in my jsp:
 
form name=update method=POST action=/abc/XMLServlet
input  type=button name=save_change value=Save onclick=saveChange(event)
input  type=button name=cancel_change value=Cancel 
onclick=cancelChange(event)
input type=button name=edit value=Edit onclick=checkLogin(event)
/form
 
If I click on Edit button, the javascript checkLogin will submit the form.  
If the user has not logged in, an authentication window will pop up.  After the 
first-time authentication, the page is directed to the same page containing the 
above form.  I intentionally set setMaxInactiveInterval to be like 10 seconds 
in XMLServlet.  When the session expires, I click the Edit button again, now 
the page directly go to XMLServlet without the authentication window poped up.  
 
Does anyone know what causes this?  How can I get the authentication window pop 
up when the session expires?  Thank you for your help.
 
 
Gia
 
 


-
Do you Yahoo!?
 Yahoo! Search presents - Jib Jab's 'Second Term'

How to make tomcat 5 not persist session?

2005-01-11 Thread Gia Thornton
Hi there,
   I am developing jsp to run in tomcat 5.0.18.  I need to store a java class 
object in session.  The class is not serialized.  I got error message:
 
SEVERE: IOException while loading persisted sessions: 
java.io.WriteAbortedException: writing aborted; 
java.io.NotSerializableException: (class name)
 
I know that tomcat use session manager to persist sessions and reload them when 
server starts up.  But I can not find where to configure it.  How can I turn it 
off so that I don't get the error message? Can anyone give some suggestion?  
Thank you very much.
 
 
regards,
 
 
 
 

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: How to make tomcat 5 not persist session?

2005-01-11 Thread Gia Thornton
Hi,
   Sorry I have found the answer.  I need to add 

Manager className=org.apache.catalina.session.StandardManager pathname=/
 
to application context.
 
 
regards,


Gia Thornton [EMAIL PROTECTED] wrote:
Hi there,
I am developing jsp to run in tomcat 5.0.18. I need to store a java class 
object in session. The class is not serialized. I got error message:

SEVERE: IOException while loading persisted sessions: 
java.io.WriteAbortedException: writing aborted; 
java.io.NotSerializableException: (class name)

I know that tomcat use session manager to persist sessions and reload them when 
server starts up. But I can not find where to configure it. How can I turn it 
off so that I don't get the error message? Can anyone give some suggestion? 
Thank you very much.


regards,





__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com