Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Rick Murphy

+ Follow
since Nov 02, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rick Murphy

Hello All:

I have a situation here that I need to cast an Object type at run time dynamically. I already know the class name is valid and myMethod() and "myString" are all valid. What do I need to fill in, as in the following code...

public method(Object o)
className=getClassName(); //I can get this.
///how am I going to use the className into casting?
(fill in here)o).myMethod() = "myString";

Thank you.

15 years ago
I ended up using iframe. It seems to be fine for now. Thank you.
16 years ago
Hello Jess:

What you described was absolutely right. I used that kind of directory in a regular web application. Yes, anything beyond /WEB-INF/ is prohibited from direct access via http.

My apology that I need to say more in my original post... When I looked at some articles from the internet, sorry can't recall where. To avoid direct http access from portal we purposely move jsp folder behind /WEB-INF/ and use xml file to control controller's behavior (in MVC model). For example, in struts-config.xml you may forward a success action to /WEB-INF/jsp/myJSP.jsp. That is where I got the idea. In stead of a http call, it seems like some mechanism there treats this as a directory path, and an url was then created somehow meaningful for the portal container. If you print out that URL, it is totally meaningless.

All those require user to call a controller class (action class) from a link and then do a forward. It would be easier if you can get a simple url link generated using some function takes /WEB-INF/myFiles/blah.pdf as input and generate a url that is meaningful to portal.

Thank you for your help. I do appreciate it.

16 years ago
OK Jess:

Do I get a award by doing that? you see I already corrected...

Well, to your suggestion, kind of. I am new to this portlet stuff so bear with me a little...

As I learned from internet, I put my jsp and all other directories such as myFiles underneath /WEB-INF/, say /WEB-INF/myFiles/blah.pdf.

This is not working for me in a portlet environment, since I don't seem to find a way to point to there? In your reply what do you mean by ...just generate a link in your application to that URL and it can be accessed directly... could you elaborate it? How to generate a link? I think that might help. I am doing all this in JSP right? Thank you again!!!

16 years ago
Hello Everyone:

Please shed some light on this one:

I need to create a link in a porlet to point to a pdf file in the application directory, to have the same effect that I would get from a link in a regular page. I know that url doesn't mean much for a portlet since a portlet is within a portal container. It seems like that the options left are limited: create a controller or use a redirect. But what do I put in there? It is OK to forward to a jsp or html, but I am asking for a pdf or word doc.

some sample code would help.

Thank you.
16 years ago