Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Help My tag handler!

Thread view: 
shruds - 24 Jan 2006 06:58 GMT
hi, i have a Tag Handler called simpleTab who just has to do the
following :

public void doTag() throws JspException, IOException {

etJspContext().getOut().write(
"<td width=\"6\" img src =\"images/tab-left_active.gif\" border=\"0\">
</td><td align =\"center\"  class=\"tab\" style=\"cursor: pointer;
background: url(images/tab_bg_active.gif)\"
onClick=\"TAB.changeActive(this)\">" + this.title +
   "</td><td width=\"6\" img src=\"images/tab-right_active.gif\"
border=\"0\"></td> ");

Now title is a tag Atrribute i'm passing from a jsp, now there are 2
problems :
1. i can see this html in the source of the page i want this html to be
in, but it is not showing up on the page!!!
2. the source doesnt have the "title" i plug into it in the doTag
method.
whats da problem?
ilkinulas - 24 Jan 2006 07:43 GMT
it is really hard to read code like this.
if you need to generate html from java you can write something like
this:
etJspContext().getOut().write("<td width='6' img src
='images/tab-left_active.gif' border='0'>");
I mean try using ' ' instead of " ". It makes your code more readable.
shruds - 24 Jan 2006 08:21 GMT
okie now?
public void doTag() throws JspException, IOException {

getJspContext().getOut().write(

'<td width="6"><img src="images/tab-left_active.gif"
border="0"></td><td align="center"  class="tab" style="cursor: pointer;
background: url(images/tab-bg_active.gif)"
onclick="TAB.changeActive(this)">' + this.title+' </td><td
width="6"><img src="images/tab-right_active.gif" border="0" ></td>');
shruds - 24 Jan 2006 09:01 GMT
no its not i know!  should read like this :

"<td width='6'><img src='images/tab-left_active.gif'
border='0'></td><td align='center'  class='tab' style='cursor: pointer;

background: url(images/tab-bg_active.gif)'
onclick='TAB.changeActive(this)'>"+ this.title+' </td><td
width='6'><img src='images/tab-right_active.gif' border='0' ></td>");
sorry for da earlier post.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.