aspose file tools*
The moose likes Servlets and the fly likes HREF in servlets..... errrrrrrrrrrr frustrated.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HREF in servlets..... errrrrrrrrrrr frustrated...." Watch "HREF in servlets..... errrrrrrrrrrr frustrated...." New topic
Author

HREF in servlets..... errrrrrrrrrrr frustrated....

c cannata
Greenhorn

Joined: May 08, 2001
Posts: 3
This is the piece of code I have been hacking on for some time now.


Currently..... I have this.... and it works... it
returns stuff from the database...

public void printCategories(HttpServletRequest request, HttpServletResponse response, String trade, int x, String[]
pslLevelTwoCategories, PrintWriter out) throws IOException

out.println("<B <INPUT TYPE=\"RADIO\" NAME=radio1 VALUE=" + pslLevelTwoCategories[y] + " " + pslLevelTwoCategories[y] + "</a <br ");


This is what I would like it to do...

out.println("<a href=\"http://localhost:8000/servlets/MainSearch?=\" "+ pslLevelTwoCategories[y] +" " + pslLevelTwoCategories[y] + "</a <br ");


For the life of me I cannot get the params correct in the href and I keep getting a error message of not found etc. If you are interested in helping me with this I can send you the entire piece of code, but for this it's just really short.
Thanks
Chris
Maky Chopra
Ranch Hand

Joined: Apr 11, 2001
Posts: 149
what should your url look like ? And what text do you need hyperlinked ?
Maky Chopra
Ranch Hand

Joined: Apr 11, 2001
Posts: 149
"c cannata",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12674
    
    5
out.println("<a href=\"http://localhost:8000/servlets/MainSearch?=\" "+
pslLevelTwoCategories[y] +" " + pslLevelTwoCategories[y] + "</a <br ");
It looks to me like that code will write a quote just
after ?= so the href will not include your data from
the categories. Also I think you want just ? not ?=.
Debugging tip: Do a view source of the form page whenever you dont get the expected results from a form.
Bill

------------------
author of:


Java Resources at www.wbrogden.com
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
A sample href link is here.
<a href="http://localhost/MISApp/welcome.jsp?login=yourName&password=yourPasswd"> Click here </a>
regds
maha anna
c cannata
Greenhorn

Joined: May 08, 2001
Posts: 3
I guess what I am asking is in you outprint statment what would you put if you currently had this.

out.println("<B <INPUT TYPE=\"RADIO\" NAME=radio1 VALUE=" + pslLevelTwoCategories[y] + " " + pslLevelTwoCategories[y] + "</a <br ");
and you wanted a href instead. What code would I write to make this into a url instead of a toggle button. I have tried multiple ways and nothing seems to work. I am just tired of people complaining to me that they cannot see the submit button at the bottom of the page.
cc

Originally posted by maha anna:
A sample href link is here.
<a href="http://localhost/MISApp/welcome.jsp?login=yourName&password=yourPasswd"> Click here </a>
regds
maha anna

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HREF in servlets..... errrrrrrrrrrr frustrated....
 
Similar Threads
session listeners
problem with setContentType() method
SESSION TRACKING.
About create a session!
How to disable cookies