Chris Perth

Greenhorn
+ Follow
since Oct 15, 2003
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 Chris Perth

It's workiiiiing!!!

Thanks!
Chris
20 years ago
I already figured it out...
Thanks anyways!
Chris
20 years ago
Hi!!!
I finally solved my silly problem!
And I didn't need to get rid of my HashMaps either!
It was so easy I'm now feeling really dumb!
With one extra line in my code I used a TreeMap to
sort the HashMap I had and now my select is all
alphabetically organized just like I wanted!
I'll probably post again soon with a new problem,
so stressful this last week... Hope I'll survive...
Take care and thanks for all the help! Gotta run...
Cheers Sahil!
Chris
20 years ago
I'm still working out with sorting my labels on my
option collections... but the good news is, I got the two
selects I'd been trying with different maps and ResultSets!
It was a stupid sql mistake, typical, me trying things out
again positioning it in the wrong place of the code, but
now it works!
Any ideas or small snippet of code on ArrayList sorting to
be used on my form would still be apreciated.
Chris
20 years ago
Thanks Sahil
I sort of had figures it out already how them maps
don't keep any sorted order... How I wish I'd learned
all this stuff before having to start this project!
Since I just need the labels sorted and not the values,
maybe I'll try out keeping my maps AND an ArrayList to
sort the labels for the options.
I'll certainly check out your code again from my
other post, I'm really thankful for it! (and I'm a
chick nor a dude by the way)
Take care and (if you're into that) happy Halloween
Chris
[ October 31, 2003: Message edited by: Chris Perth ]
20 years ago
Hi you guys,
I have this question on my other post from my select options
which has been solved (at least partially)...
Now I'm really struggling with these two issues:
(maybe Yoo-Jin knows this? Hope he's not too busy)
-Is there a direct way to sort the keys/labels alphabetically?!
I'd really love it that the options on my select are organized!
I mean, the select from the database is already distinct and
ordered by that particular row, but still, no matter in what order
I put the stuff into the HashMap, it always lists the content
all scrambled up into my select!!!
(I saw somewhere that I could use a sort method but that it won't
work directly with the Map but rather with the key through an
ArrayList, is that right???!)
-I tried as experiment doing another select (once one worked I
got carried away!) so this time I wanted the colors and the
textures to be taken from the database... but it didn't work!
Maybe it lays on my sql ResultSet (maybe only one can be done
at a time?!), any ideas how I can do this? (I'll need two
HashMaps and two pageContext.setAttributes)
I'd appreciate any help with this! Been two days suffering already!
Thanks!!!
Chris - learning Struts through mistakes...
20 years ago
Hi!!!
Yoo-Jin:
Thank you so much for the help!!! I ended up using the HashMap
like you said and my select option collection works!!!

Eric:
I did manage to get the stuff from the database and put it into
the ArrayList, but even though I tried like crazy to find out where
was the mistake, I gave up in the end, sick and tired of that
blank page "Done" I told you about... (I hate it that no matter if
I monitor Catalina on my tomcat it never shows where/what my
mistake/problem is!!!)
One more question, actually two! (maybe I'll write a new post)...
Maybe to you Yoo-Jin who has experience with HashMaps...
-Is there a direct way to sort the keys/labels alphabetically?!
I'd really love it that the options on my select are organized!
I mean, the select from the database is already distinct and
ordered by that particular row, but still, no matter in what order
I put the stuff into the HashMap, it always lists the content
all scrambled up into my select!!!
(I saw somewhere that I could use a sort method but that it won't
work directly with the Map but rather with the key through an
ArrayList, is that right???!)
-I tried as experiment doing another select (once one worked I
got carried away!) so this time I wanted the colors and the
textures to be taken from the database... but it didn't work!
Maybe it lays on my sql ResultSet (maybe only one can be done
at a time?!), any ideas how I can do this? (I'll need two
HashMaps and two pageContext.setAttributes)
I'd appreciate any further help!!! You guys are great!
Chris
20 years ago
I think I'm getting there... Thank you so much Eric!
I'll post later with the results, if it worked...
Have a nice week!
Chris
20 years ago
Thank you so much Jason,
I'll try that out and post to say if it worked!
I hope it does!
Take care
Chris
20 years ago
Hi Eric,
maybe I'm mixing all my .javas together. I think I sort of understand how to
put my jsps together and enter the paths and infos in the struts-config but I
seem to always have trouble with the beans, and no matter how many
examples I've been looking into none seem to match closely enough to what
I've been trying to do so that I can realize what or where I've been going
wrong!
Could you please tell me how many .javas you use and which one is being
called by the .jsp to show the select options (the collection)? Like, which one
does what? I tried writing a separate bean just to grab the option but it didn't
work, then I added an ArrayList and collection part in my old .java, it's all so
frustrating that after a few whole days (and nights!) merged with the problem I
feel like I'm getting more and more confused by the second!
Thanks
Chris
20 years ago
Hi Eric!
I think your idea might really work!!!
So far I haven't been able to integrate it to my code though,
I mean, I think I made the changes like you suggested and it compiles
& builds ok but when I load it the page with the changes shows blank
("done"), then I check the code on my browser and it shows nothing (??!).
Is it too much to ask (if what you're working on is indeed the same of
what I'm trying to do--which seems like it is!) if you could please post or mail
me with more instructions or a bit more of the code?!
I'm probably (as usual) doing something silly wrong (sometimes takes a
whole long & frustrating day to find a mistake like a simple mistype or
symbol in wrong place!)
Thank you so much! Wishing you luck with your project,
Chris
20 years ago
Hi Sahil,
thanks for answering to my other post... I'm still working on both my problems.
I can't use my messanger at the moment so I'll have to answer you right here
(about my experience with struts and mysql)...
Like you I've just started working with that, so I can't say I have much experience
at all, unfortunately. Learning mostly by trying and by (MANY) mistakes... :roll:
It's all very interesting but also complicated & stressful...
Anyway, I wish you a lot of luck with struts & mysql!
Take care!
Chris
20 years ago
Hi Jason, thanks for answering!!!
I'll try to explain...
My problem doesn't lay on my jsp but rather on my java class!
I have 3 .javas which need each other to make the search form work:
There's the
SearchAction.java
SearchForm.java
and the
DisplaySearchResult.java
On my searchContent.jsp there's the html:form with the name of the action.
The form has the select and text fields in which you enter the search criteria.
When you press the search button the SearchAction.java is called (and it itself
calls the SearchForm.java to get the value from the fields).
Then (if everything goes well with the sql) it's all sent to the DisplaySearchResult.java.
The DisplaySearchResult.java prints in searchResultContent.jsp the table
with the search result according to the search criteria.
The problem lays in the DisplaySearchResult.java!
Here's a piece of the code where the database values are put into a table to
be printed: (rs is the ResultSet from the database)

As you see above, I can only add the link in my DisplaySearchResult.java IF it's
a simple HTLM link!
What I wanted (and already tried but didn't work) was something like this:

If I add any kind of html:link or whatever that's not simple html, it isn't interpreted as it
should!
It turns up as a normal link or something. Maybe it's a common knowlege and I'm too
new on this, but if it is so (that this kind of forms and links can't work inside a .java)
then what can I do??!!
These 'texture' values that are gotten from the database HAVE to have some sort of link that
will take upon clicking to another page which, will call yet another new DetailedAction.java
which will print another table with detailed info (also from the database) from this texture!
Know what I mean now? I hope I didn't make it all even more confusing to be understood...
For any ideas I'd be thankful!!!
Chris
[ October 23, 2003: Message edited by: Chris Perth ]
20 years ago
Thank you so much for helping Eric & desi dude!
I just got here so I'll look into both ideas and see if it works!
Suspense...
Exciting though, dying to see this form working!
Chris
20 years ago
Thank you Junilu!
I'm going through these tutorials maybe it'll really help! (hopefully!)
Chris
20 years ago