Ricky Jay

Ranch Hand
+ Follow
since Feb 12, 2010
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 Ricky Jay

Are there any decent books, possibly one book, that could teach you JSF and Spring in one go? I know JSP/Servlets and would like to make an easy transition into JSF. I'm looking for a good starting point.

Any suggestions?

Links to tutorials work also.
13 years ago
JSF
Is SHA512 hash encryption the same in PHP/JAVA?

if I hash apple in a php program, will it be the same in a java program?

Just curious if anyone know the answer. I know it's an algorithm, but didn't know if they used the same one
the different languages.
13 years ago
Is it possible to connect to more than one database in the same connection pool object? Or do I need to create a connection pool object for each database I connect to?
I'm using JSP/Servlets...so I was curious about how to go about this and how I would set up my context.xml file.

My users are in a seperate database than my application database.
Didn't see the rest of the thread. Comment was not relevant.
13 years ago
JSP
After briefly reading about map topics(hashMap treeMap) I've noticed it uses a KEY,Value combination.

I haven't tested this yet, but I'm thinking about
Pseudo:
key=make
value=listObject
store it as a map...then just recall the list by the "make" key.
13 years ago
JSP
I guess I will have to get back to you on how I would tie the two together. I'm going to have to read up on maps. Thanks for pointing me in the right direction...I'll post my conclusion later.
13 years ago
JSP
I'm still kinda new...the only collection I have worked with thus far has been arraylists.

Is this something I would need to takle with a map? Any suggested reading?
13 years ago
JSP
I'm trying to print out an arraylist in my JSP page with headings. Here is an example:

Data..
ID Model Make
1 S10 Chevy
2 F150 Ford
3 F250 Ford
4 Silverado Chevy
5 Tacoma Toyota
6 T100 Toyota
7 Ranger Ford

Chevy
1 s10
4 Silverado

Ford
2 F150
3 F250
7 Ranger

Toyota
6 T100
7 Tacoma


When doing it like this...


I'm getting

Chevy
1 S10
Ford
2 F150
Ford
3 F20
Chevy
4 Silverado
Toyota
5 Tacoma
Toyota
6 T100
Ford
7 Ranger

How do I go about sorting this data to be put under a heading of "Make". Is this not something that should be put into an arraylist?
13 years ago
JSP

Bear Bibeault wrote:

Ricky Jay wrote:I didn't know that this could be down through ajax


Why not? From the point of view of the server, an Ajax request is just like any other request.

2nd request: please edit your code to wrap and keep this topic from being so wide.


Thanks Bear.

This topic is complete. Do not use a servlet to output javascript.

Use this method:
AJAX --->SERVLET--->JSP(forward to jsp)

Thanks again. I've tested this and it works.
13 years ago
So I should move it like this:
Ajax calls Servlet.
Servlet gets data from DB and then sends that to the jsp?

I didn't know that this could be down through ajax. I'm trying to load a div box with data based off a call.
13 years ago

Bear Bibeault wrote:

Ricky Jay wrote: I'm wanting to move it to a servlet that will generate the code off an ajax call.


Why would you do that?

If it's working in the JSP -- the appropriate place for it in any case -- why move it?


cause on this particular jsp page that it is woring on has some business logic/ database calls and I was wanting to just move it to the servlet.


I'm still a "greenhorn" so my approach to somethings probably isn't the right way. I'm learning by trial and error.

So is having a database call from a jsp page, a bad thing? That's what I was trying to avoid.
13 years ago
hang on, I might be on to something.
I'll try to put the ' ' around the javascript and inside use \"
13 years ago
I'm sorry, you may have miscommunicated this to you.

It is working on the jsp side right now. Right now I'm using ajax to call the jsp page that his javascript is sitting on. It works fine. I would like to convert this to the Ajax calling hte servlet and it outputing the html/javascript that is on that jsp page. I'm just copying the code from the jsp page. so I don't know what is wrong. I've added the "\" before the " on the lines of code.

Does this make more sense?
13 years ago
This is the line of code i think that is messing up:

13 years ago
Is there a certain way you have to code your javascript in your servelt out.println(); ?

I have html/javascript that works fine on the jsp page. I'm wanting to move it to a servlet that will generate the code off an ajax call. It's outputing all the html code correctly everything looks correct, but my "onclick" java functions aren't working. I've just copied and pasted the code in.

Is there any tricks to getting this working?
13 years ago