Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5935367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:14:39+00:00 2026-05-22T15:14:39+00:00

For example, a user will be rendered throughout my application as <div class=user> <p

  • 0

For example, a user will be rendered throughout my application as

<div class="user">
  <p class="username">${user.name}</p>
  <p class="karma">${user.karma}</p>
  <img src="/users/${user.id}"/>
</div>

How can I reuse this code block?

Note – my code is running within a tag, so I can’t use tags for this (or any JSP) otherwise I get a Scripting elements are disallowed here error.

Edit

I’m trying to use a tag file, but getting PropertyNotFoundException.

This is my tag file called ‘user.tag’:

<%@tag description="User" pageEncoding="UTF-8" %>

<a href="../user/showUser.do?userId=${user.id}">
    <p>${user.name}</p>
    <img class='avatar' src='${user.avatarUrl}' alt=""/>
</a>

And usage inside a jsp:

Where job.poster is a java bean with id, name, and avatarUrl properties.
If I add

<%@attribute name="user" %>

to the tag file, then I get an exception

Property 'id' not found on type java.lang.String
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:14:40+00:00Added an answer on May 22, 2026 at 3:14 pm

    Since JSP 2.0, there is yet another kind of tags: Tag files. Tag files are JSP custom tags written as a JSP template itself, which seems to be what you want.

    http://fforw.de/post/creating-jsp-layouts-with-page-tags/ shows how to use such a tag file as general layout solution. Using them as component should be even easier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model defined as below: class Example(models.Model): user = models.ForeignKey(User, null=True) other
I have a rather large class stored in the datastore, for example a User
I am making a application that the user will have to interact with one
Objects: Object Sale n Object User will participate on Object Sale Each User can
I am currently developing an application in where a user will dynamically choose dlls
Example URLs http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo http://www.youtube.com/watch?v=cKZDdG9FTKY&feature=channel http://www.youtube.com/watch?v=yZ-K7nCVnBI&playnext_from=TL&videos=osPknwzXEas&feature=sub http://www.youtube.com/ytscreeningroom?v=NRHVzbJVx8I Any regex that will pull the correct YID
Example user input: PA1 9 //correct PJ1 9 //wrong, error printed Invalid row because
Example: The user login to the webpage => Click on a button This action
For example if the user is currently running VS2008 then I want the value
When I look at the example of the user extensions of GWT-Ext I saw

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.