This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!

Chris Reeves

Ranch Hand
+ Follow
since Apr 03, 2002
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 Chris Reeves

I'm working on some portlets for weblogic 8.1 portal server.
I've created my portlets, and I'd like to bundle them into jars (or the like) for distribution.
Does anyone have pointers on how to do this and what it should look like? Ideally, I'd like to drop the portlet jar into a lib directory and have them deploy right into weblogic for use in a portal.
Any help would be appreciated. Thanks!
Chris
16 years ago
Must be a low brain power day - I solved my issue as I posted it.
I just move the string to a string buffer, in which I can do the replace, then do toString for output.
Thanks for listening.
Chris
17 years ago
I need to replace end of line characters ('\n') with html breaks (br).
However, I'm stuck using jdk 1.3.1, so I don't have the luxury of regex.
Any quick and dirty low tech ideas out there?
Chris
17 years ago
Andy, you took the words right out of my mouth.
I am going to try it with a servlet - I know that will work.
But, if anyone else has any ideas, please chime in.
17 years ago
JSP
I need to return a file to the browser through a jsp. The file contains binary data, so I need to return bytes.
Here's the catch: I'm writing the jsp to run under coldfusion mx. So, while I would normally call getOutputStream, I encounter a java.lang.IllegalStateException when calling getOutputStream. This means that getWriter has already been called.
So, I'm stuck with a writer, trying to write bytes. The writer is happy to write the bytes (which return as integers), or I can convert them to char.
This output is close to the original, but doesn't product the file I'm returning exactly. I blame this on the character encoding used by the Writer.
Any suggestions on how to coerce the writer to write bytes without any encoding? Or other ideas? I'm stuck with the writer, as coldfusion seems to take care of that on its own.
Thanks!
Chris
17 years ago
JSP
First, you'll want to make sure tomcat is running (the default port, 8080, is fine). I advise that you run your servers behind a firewall, so you can block direct requests to 8080.
Next, install apache. If should be listening on port 80. It will manage all inbound requests, sending them to tomcat as needed.
Next, read this document:
apache mod_proxy
Modify the httpd.conf for apache per the document above. Spend some time getting to know mod_proxy - you'll be glad you did. You'll want to map inbound requests to proxy back to the equivalent on tomcat. For instance:
http://myhost.com/myapp/
should map to
http://myhost.com:8080/myapp/
Using this setup, you can even install tomcat on a totally different machine. You can also change the paths at the apache level to mask the url that is getting called from tomcat. I don't really recommend this, as it is an easy spot to introduce problems into your application.
Good luck!
17 years ago
Tony -
What path are you requesting when you get a 404?
17 years ago
If you use apache's proxy capabilities, you can avoid the connector and the cookie issues.
17 years ago
I believe you need to provide the fully qualified exception, with package:

Of course, if you're exception isn't in a package, that won't apply.
17 years ago
You're missing the target a bit here.
You don't need to declare anything abstract. This is just the compilers way of saying that it found a method in the interface that you are implementing that is not in the class.
So, if you have:
interface MyInterface
public void method1();
public String method2();
In your implementation you must have:
class Thing1 implements MyInterface
public void method1() {}
public String method2() {}
I often see this error when I decide that a method should have a new parameter, but failed to add it to the interface.
17 years ago
You'll want to have a look at the logs - tomcat/logs.
There will be some clues in there to help you out...
17 years ago
You would have to use frames to do this.
You can try this; no guarantees here though.
In the html for each frame, you must declare a form; in this form tag, give the form a name.
e.g.:
<form name="form1" action="whatever" method="[POST/GET]">
Next, in the form that contains the submit button, add some hidden fields, one for each field you'd like to submit from the other frames.
Then, change the action for this form to a javascript function. In this function, you'll want to copy the values from the other frames/forms in your hidden fields. Then submit().
It's not pretty but it should work. As for me, I'd just get rid of the frames.
I would like to add some parameters and values to a forward action - in other words, I would like to dynamically add variables to the url without modifying the struts-config.
I can do this by modifying the ActionForward with setPath(), but it seems there should be a cleaner way to do this. For instance, I might like the forward to act as a POST.
Any ideas?
17 years ago
It's really a deployment issue. I have to render multiple sites, all with the same function but with different templates. Rather than incorporating the templates into the web app (I have an external tool that will manage the look and feel and will create the html pages offline), I want to keep them isolated, and pull them in dynamically.
I will have, potentially, hundreds of other sites. So, I don't want to put them in my webapp - which is actually just part of a larger enterprise app.
17 years ago
JSP