Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!

Marc Santiago

Greenhorn
+ Follow
since Dec 11, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marc Santiago

OK, I've confirmed that we are getting the headers correctly using livehttpheaders (neat tool, that!). I've also tried setting content type to text/xml and then text/html, but I still keep getting "type not available".
Here's my code. Am I missing something obvious?

[ January 30, 2004: Message edited by: Marc Santiago ]
14 years ago
JSP
I was able to confirm the headers by reviewing the debug messages in the server log.
And yes, I'm sure I am setting the content type prior to writing anything out. I thought that might have been it at first as well, so I rewrote my JSP to buffer all of my output into an ArrayList, call setContentType, and then feed the ArrayList into out.println(). Same result (type not available).
Interestingly enough, when I take out the guts of my JSP and replace it with a basic out.println("foo"), I get the correct content type. All I'm doing in this app is accepting a directory name from the user, reading in all the files in the directory, and redirecting the contents back out to the browser. The only call I make to the response object is with the setContentType call.
14 years ago
JSP
My JSP page sets the content type via a response.setContentType("application/xml") call. However, when I browse the page in IE 6.0, it says "type: not available". I've confirmed on the server side that it is indeed sending application/xml as the content type in the header. Anyone else ever see this happen before?
14 years ago
JSP
My company's running an ancient version of WAS that appears to only have JSP .91. I'm trying to set the content type using the response implicit object - response.setContentType(), - but it doesn't appear to be working. Is there any other way to set the content type?
14 years ago
JSP
I'm just starting to get into XML processing with Java. Everything I read about SAX and DOM processing in Java seems to require external packages. Does SDK 1.3 or 1.4 have any 'built-in' SAX or DOM packages, or will I have to make these external packages (org.xml.sax, org.w3c.dom, javax.xml.parsers) pre-reqs for any XML processing?
Or am I really, really confused?
I'm trying to make a call to application.getRealPath() on a WAS server that appears to be running JSP 0.91, and failing miserably. The same code works fine on a Tomcat 5 server running JSP 1.2. The error messages seem to be indicating that the application implicit object is undefined.
Were implicit objects available in 0.91? If not, does anyone have a suggestion as to how I might acquire the real path of a file under 0.91?
TIA.
14 years ago
I guess I didn't think that all the way through before. Thanks for clearing things up!
14 years ago
But what about the non-Java components of my application? I can no longer refer to src="./images/mylogo.gif", for example. Instead, I have to write an expression to have the server insert the context path in the appropriate space. This would seem to be an overly complicated and fairly invasive solution. Why do they do it this way? Is this considered a strength or a weakness of Tomcat?
14 years ago
I'm a complete Tomcat/Apache newb. I'm trying to build a JSP app to run on my company's WAS server. I figured I'd install Tomcat on my home PC and test it there before bringing it into work, but I'm not sure if I have it configured properly. Here's what I have so far:
I installed Tomcat in a directory on my WinXP box - C:\tomcat.
I created a context with path=/mylog and docpath=c:\tomcat\webapps\mylog.
When I point my browser to localhost/mylog, I get my index.jsp page properly.
Now I'm trying to put in a servelet to display the contents of a sub-directory - c:\tomcat\webapps\mylog\logs. I do this with the following code:
File groupDir = new File("./logs");
Instead of getting a sub-directory of /mylog, I get c:\tomcat\logs. According to my searches here on JavaRanch, this is to be expected since all relative paths start from the server path (c:\tomcat, in this case). If I want to point to my application's root path (/mylog), I have to make a call to resource.contextPath() and slap it in front of /logs, i.e.,
File groupDir = new File(resource.contextPath() + "./logs");
Does this sound right? Is there any other way of setting up the server so that relative paths work 'correctly'? Finally, can anyone give me a decent explaination for why the developers would want to confuse me like this ?
14 years ago
The Ostermiller Browser looks like exactly what I'm looking for. Thanks!
Oh, and I fixed my name. Sorry about that - I'm just a little paranoid about my private info.
14 years ago
I'm kind of looking for a non-platform-specific implementation, so starting an instance of IE wouldn't always work. What I was really looking for was a way to say to the OS, 'I want to display this web page - go fire up whatever you use for a browser and load this URL'.
I'm curious about the Swing implementation. Does this embed a web browser into your standalone app, or does it somehow invoke the OS's 'default' web browser? If it uses its own embedded browser, would it understand Javascript? I couldn't tell from just reading the page.
Thanks everyone for all your help!
14 years ago
From a standalone application, I want to start up a browser session (if one isn't available already) and load a web page (my website's FAQ). How do I do this?
14 years ago