exception.getMessage()

2003-08-15 Thread James Michelich
Hello,

I'm having a problem with 'exception.getMessage()' - whenever I throw 
an IOException with a message (i.e. throw new IOException("error") ), 
my error jsp page displays nothing.

I have the java.io.IOException mapped in web.xml to a jsp error page.

Thanks,

James

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



RE: Setting error page for servlets

2003-08-15 Thread James Michelich
Thanks! That solution worked out very well for me.

One other quick question, if you don't mind - 

I've checked the servlet specs and found that the request.getRemoteAddr
() method does not throw any exceptions, but I'd like to know if this 
method is always guaranteed to return a non-null, valid IP address.

Thanks,

James



-- Original message --
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 15, 2003 2:36:33 PM
Subject: RE: Setting error page for servlets


Howdy,

>The problem with that solution is this - I have written my own
>exception, and cannot override the list of exceptions associated with
>the doPost() method.

Hmmm... I think the error page might still be able to work.  Try making
your exception a runtime one, so that you don't have to declare it.  
The
container will still map it according to the definition in web.xml
(which will have the class of your custom exception).

Yoav Shapira



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.


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



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



RE: Setting error page for servlets

2003-08-15 Thread James Michelich
Thanks for the info.

The problem with that solution is this - I have written my own 
exception, and cannot override the list of exceptions associated with 
the doPost() method.

Am I just misinterpreting your previous post, or is there another 
solution for this?

Thanks for the help,

James


-- Original message --
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 15, 2003 1:14:07 PM
Subject: RE: Setting error page for servlets


Howdy,
Seeing how a JSP is a servlet, I'd be very surprised if there was
something you could do with JSPs and not with a servlet ;)

Use the  directive in web.xml ;)  The Servlet Spec section
on the deployment descriptor has details and examples.

Yoav Shapira
Millennium ChemInformatics


>-Original Message-
>From: James Michelich [mailto:[EMAIL PROTECTED]
>Sent: Friday, August 15, 2003 1:00 PM
>To: [EMAIL PROTECTED]
>Subject: Setting error page for servlets
>
>Is there a way to set the error page for a servlet (i.e. something
>comparable to using the page directive with 'errorPage=error.jsp' in
>jsp's)?
>
>Thanks,
>
>James
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.


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



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



Setting error page for servlets

2003-08-15 Thread James Michelich
Is there a way to set the error page for a servlet (i.e. something 
comparable to using the page directive with 'errorPage=error.jsp' in 
jsp's)?

Thanks,

James

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



RE: Forwarding control

2003-08-14 Thread James Michelich
Mike,

Your suggestion worked out perfectly!  Thanks for the help.

One other quick question, if you don't mind - since sendRedirect() 
doesn't send along the request object, is there another way to access 
it from the target url while still using this method?

Thanks,

James


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



Forwarding control

2003-08-14 Thread James Michelich
Hello, any help would be much appreciated.

The basic scenario is as follows - I have a form page called form.jsp 
(http://localhost/webapp/form.jsp).  Upon submission, the form data is 
processed by a servlet mapped to the url '/process' 
(http://localhost/webapp/process).  Once the servlet has completed 
processing the form data, it forwards control to a results page 
(http://localhost/webapp/result.jsp) via

RequestDispatcher dispatch = request.getRequestDispatcher
(forwardPath);
dispatch.forward(request, response);

My question is this - although control has been forwarded to the 
results page, the browser's url is still 
http://localhost/webapp/process, which is ok with me; however, if the 
page is refreshed, the browser prompts for the form data to be 
resubmitted and the processing is repeated (which for my application 
happens to be quite substantial), rather than refreshing the contents 
of the results page.

I suppose this is a minor annoyance that could be worked around by 
displaying a link to the results page rather than forwarding directly 
to it, but I'd rather implement the latter.

Does anyone know of a solution or workaround for this problem?

Thanks in advance,

James


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



Re: Forwarding control

2003-08-14 Thread James Michelich
That's exactly what I needed to know.

Thanks, Mike.


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



invalidating sessions

2003-07-23 Thread James Michelich



A quick question about invalidating 
sessions:
 
Is there a way to detect whether a session is still 
active without implementing some sort of login/logout scheme (i.e. is there some 
way to invalidate a session without explicit input from the user, other than 
simply letting it time out)?
 
Thanks,
 
James
This message has been 'sanitized'.  This means that potentially
dangerous content has been rewritten or removed.  The following
log describes which actions were taken.

Sanitizer (start="1058992325"):
  Forcing message to be multipart/mixed, to facilitate logging.
  Writer (pos="1132"):
Part (pos="1181"):
  Part (pos="200"):
SanitizeFile (filename="unnamed.txt", mimetype="text/plain"):
  Match (rule="8"):
ScanFile (file="/var/spool/filter/anomy/att-3f1ef0c5-MO3-unnamed.txt"):
  Scan succeeded, file is clean.

Enforced policy: accept

  Part (pos="645"):
SanitizeFile (filename="unnamed.html", mimetype="text/html"):
  Match (rule="8"):
ScanFile (file="/var/spool/filter/anomy/att-3f1ef0c6-88E-unnamed.html"):
  Scan succeeded, file is clean.

Enforced policy: accept

Note: Styles and layers give attackers many tools to fool the
user and common browsers interpret Javascript code found
within style definitions.  References:
 - http://www.securityfocus.com/bid/630
 - http://archives.indenial.com/hypermail/bugtraq/2001/January2001/0512.html
Rewrote HTML tag: >>_STYLE_<<
  as: >>_DEFANGED_STYLE_<<
Rewrote HTML tag: >>_/STYLE_<<
  as: >>_/DEFANGED_STYLE_<<

Total modifications so far: 2


Anomy 0.0.0 : Sanitizer.pm
$Id: Sanitizer.pm,v 1.54 2002/02/15 16:59:07 bre Exp $

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

Executing external programs

2003-07-01 Thread James Michelich



If anyone could help me with this problem I'd be 
grateful.
 
Here's some of my system info, etc.:
 
Windows XP Pro
IIS 5.1
Tomcat 4.1.24
 
I'm also running Tomcat as a service via JavaService.
 
The problem is this - my web application requires 
the use of external programs, which I execute by calling something 
like
 
Process p = 
Runtime.getRuntime().exec(executablePath);
 
This works fine while I'm still logged on to my 
machine, but when no one is logged in, the external program doesn't seem to be 
executing.  While logged off, I know the Tomcat service 
is still running because I can still access my web 
application with other machines; however, when I try to use the part of the 
application that executes an external program, I get no response and the server 
times out.
 
Anyone have any ideas or solutions?
 
Thanks in advance for the help,
 
James
This message has been 'sanitized'.  This means that potentially
dangerous content has been rewritten or removed.  The following
log describes which actions were taken.

Sanitizer (start="1057091800"):
  Forcing message to be multipart/mixed, to facilitate logging.
  Writer (pos="1135"):
Part (pos="1184"):
  Part (pos="200"):
SanitizeFile (filename="unnamed.txt", mimetype="text/plain"):
  Match (rule="8"):
ScanFile (file="/var/spool/filter/anomy/att-3f01f0d8-CT6-unnamed.txt"):
  Scan succeeded, file is clean.

Enforced policy: accept

  Part (pos="1199"):
SanitizeFile (filename="unnamed.html", mimetype="text/html"):
  Match (rule="8"):
ScanFile (file="/var/spool/filter/anomy/att-3f01f0d8-U05-unnamed.html"):
  Scan succeeded, file is clean.

Enforced policy: accept

Note: Styles and layers give attackers many tools to fool the
user and common browsers interpret Javascript code found
within style definitions.  References:
 - http://www.securityfocus.com/bid/630
 - http://archives.indenial.com/hypermail/bugtraq/2001/January2001/0512.html
Rewrote HTML tag: >>_STYLE_<<
  as: >>_DEFANGED_STYLE_<<
Rewrote HTML tag: >>_/STYLE_<<
  as: >>_/DEFANGED_STYLE_<<

Total modifications so far: 2


Anomy 0.0.0 : Sanitizer.pm
$Id: Sanitizer.pm,v 1.54 2002/02/15 16:59:07 bre Exp $

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