Help My tag handler!

S

shruds

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?
 
I

ilkinulas

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.
 
S

shruds

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>');
 
S

shruds

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top