• Post Reply Bookmark Topic Watch Topic
  • New Topic

Taglib problem  RSS feed

 
Suneesh Raman
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am not able to pass the dynamic parameter to taglib . I am using the weblogic 8.1 version .

<msg:listthreads displaytype ="threads" forumId="<%=request.getParameter("forumId")%>" />

The above statement is not working but if I hardcoded the forumId it is working

<msg:listthreads displaytype ="threads" forumId="1" />

My tld file is given below


<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>msg</shortname>
<info>Discussion forum tags </info>

<tag>
<name>listforums</name>
<tagclass>com.forum.tag.ListForumTag</tagclass>
<info>Listing forums</info>
<attribute>
<name>displaytype</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>

<tag>
<name>listthreads</name>
<tagclass>com.message.tag.ListThreadTag</tagclass>
<info>Listing threads</info>

<attribute>
<name>forumId</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>rootMsgId</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

<attribute>
<name>displaytype</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>

</tag>

<tag>
<name>listusers</name>
<tagclass>com.user.tag.UserTag</tagclass>
<info>List Users</info>
</tag>

</taglib>

The above code working with Sun One

Thanks
Suneesh
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code looks okay.

When you say it isnt working, are you getting an error or is it that value is not being passed on, in which case double check to ensure that the request does have a paramter called 'forumId'.

ram.
 
Suneesh Raman
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am Not getting an error . The tag is not getting parsed . In the view source I am getting the content as

<msg:listthreads displaytype ="threads" forumId="1" />

It is taking the request.getParameter("forumId") . But not displaying the tag value required

Thanks
Suneesh
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the view source I am getting the content as

<msg:listthreads displaytype ="threads" forumId="1" />


Now how is that possible ? You shouldnt be getting jsp code in your view source. If the tag cant be parsed, jsp compilation would throw an error.

ram.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a taglib directive in your JSP page?

 
Dan Novik
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is double quote: " inside of "

Try this: "<%=request.getParameter(\"forumId\")%>" />
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The problem is double quote: " inside of "


in which case shouldn't jsp compilation have failed ? I have seen such style (without escaping) producing the correct output in apache tag library.

ram.
 
Suneesh Raman
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dan Novik:
The problem is double quote: " inside of "

Try this: "<%=request.getParameter(\"forumId\")%>" />


Thanks Dan

It's solved . But the code is working in Sun one with out escape charachter . In tomcat 4 also I had tried this and it was working fine

Thanks
Suneesh
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently just another weblogic gotcha! And people pay for this because...???
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!