• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Taglib problem

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have a taglib directive in your JSP page?

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apparently just another weblogic gotcha! And people pay for this because...???
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic