A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
PostGIS in Action
this week in the
JDBC and Relational Databases
Java Advanced Topics Training
Java in General
Question - build URL using escape characters
Joined: Jun 21, 2005
Dec 13, 2007 07:42:00
I am using a product called displaytag to create tables in my
. It is working fine but now I have to create a link in one of the columns that display a requisition number.
My problem is that I am having syntax problems trying to use escape characters to properly create my URL for this link.
Here is what I have in my
link = "<a href=\"\\reqs\"\\NonStock.action?view=&reqNum=" + reqNum + "&entityCode=" + entity + ">" + reqNum + "</a>";
What I get when I hover over the link in my JSP is:
This is half right but I do can't seem to get the rest of it.
If anyone has any experience with escape characters and can tell me what I'm doing wrong it would be greatly appreciated.
Joined: Nov 08, 2007
Dec 13, 2007 08:52:00
I suspect you're looking for the
Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read(
Joined: Oct 27, 2005
Dec 13, 2007 08:55:00
What's that \" doing after regs? That closes the href attribute!
It should probably be something like this:
link = "<a href=\"\\reqs\\NonStock.action?view=&reqNum=" + reqNum + "&entityCode=" + entity + "\">" + reqNum + "</a>";
The entire URL must be part of the href, so you can't put the closing quote until after entity.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
Joined: Jun 21, 2005
Dec 13, 2007 09:14:00
Thanks so much for the help.
Here is how I made my fix in the event it helps someone else:
link = "<a href = \"/reqs/NonStock.action?view=&reqNum=" + reqNum + "&entityCode=" + entity + "\">" + reqNum + "</a>";
Thanks again for all the help.
I agree. Here's the link:
subject: Question - build URL using escape characters
JSP and XML
Question on JWebUnit: test Link parameter
Stuck on EL syntax for request values on child page
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015