Johnny Brown

Greenhorn
+ Follow
since Jul 27, 2009
Merit badge: grant badges
For More
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 Johnny Brown

Wow..
That was quick.

It worked!

Thank you, Venkat and David.

Venkat Divvela wrote:In the actionform initialize the array productIdSelected with all the option elements. When the page is rendered the option values that match with productIdSelected values are pre selected.



Is the ActionForm properly initialized?



14 years ago
Gurus,
I am trying to use a multiple select. Data comes correct and the box gets populated properly. However, no value gets selected when the page gets loaded first time.
How do I make all elements of that box get selected by default? Following is the piece of code.

Appreciate any help.

Thanks.

14 years ago
I use an ArrayList to iterate and build textboxes inside that. When that form is submitted, only the first value (first textbox) is sent.
If I use String array in getter and setter, I face ClassCast problem when the page gets loaded first time. Following is my code. Can any one help me to figure out where I am doing wrong? Thanks guys.

Data object:


JSP:


This is how I populate data into the ArrayList


Data gets displayed when the page loads first time.
When submitting, only the first value of every month are passed (there can be multiple rows - say multiple January values). Only the first of that gets to Action.
Not sure where I go wrong.
14 years ago
Thank you, friends.
I got it resolved using getRealPath().

Thanks for the tip, Sheriff. Used it and resolved the issue.

Bear Bibeault wrote:What the problem with using getRalPath()?


To be honest with you, laziness was the problem. Had to think the way to use it.
14 years ago
Bear Bibeault:

Please do not cross-post the same question in multiple forums.


Sure, Sheriff. I thought, since this second part of my question related to Servlets, I should post it here. I feel stupid for not knowing the rules.
I'll be careful. Thanks for locking that thread for me. I was thinking of leaving a note there.
14 years ago
Wow..
I love beer. Literally.
Just check the number responses (and notice the type of responses too ) on my two threads.
Thank you fellas.

Fun apart,
Little more info about my requirement:
Action class creates charts using JFree chart and JSP access those chart images.

Following is the current setup.
At Java class:

... and at the JSP:

This setup works fine with Tomcat as webapps/<applicationName>/charts is accessible there. When we move this to WebSphere, not sure what needs to be changed.


you can find the file system location of the web app with ServletContext.getRealPath()


Action class calls another standard java class that creates images. I am clueless how to use ServletContext.getRealPath there.
Update: I retrieve following paths by using File(System.getProperty(dir)).getCanonicalPath();
Tomcat: C:\Program Files\apache-tomcat-6.0.18\bin
WebSphere: C:\Program Files\IBM\Rational\SDP\6.0\runtimes\base_v6\profiles\default
14 years ago
Hello gurus,
This is in continuation on my earlier post https://coderanch.com/t/455889/Websphere/Image-location-Websphere

Someone said that if I create the new folder (that will get image files when the Action class runs) under WEB-INF, it can be referenced easily in the JSP.
Now, I am not sure about creating folder under WEB-INF. Is there any easy way to create a folder and files under WEB-INF dynamically?

I am completely lost on this issue.

Get me some idea, your next be on me. :-)

Thanks.
14 years ago
Jeanne, I think Jayaraj's number is 100k (1 lakh?!).

Jayaraj, unless you have 100k concurrent users, accessing ActionForm shouldn't be a problem (assuming your server have good memory for processing).
Keep on adding hidden fields for every page(module), will lead to maintenance nightmare.

To me, you should change your approach.
14 years ago
If you have Websphere installable CD, check for RAD environment. It comes with Eclipse configured to Websphere (they call it as WebSphere Development Studio Client for iSeries). I have been using it with WS 6.0.
Alternatively, if you are using the regular Eclipse (the one that can be downloaded from eclipse site) you can Add servers from Servers tab (Window ->Show View -> Servers).
14 years ago
I am trying to move one of our applications from Tomcat to Websphere.

The application creates few images when a jsp gets loaded and loads those images on that jsp.
Location of the image at tomcat is "../webapps/myimage" (This is where the Action class creates that image). When jsp loads that image, it looks for "myimage/<image name>".

When we move the application to websphere, I am not sure what should be the image's path while getting created and how to access that in JSP.
I changed file creation location as just "myimage". Application makes myimage folder and creates all required images there. But jsp file doesn't read it. I don't know where I am wrong.

Anyone can throw some light on that?

Appreciate your time and help.

Thank you.
14 years ago