How to use Tag IDs generically

Well, its harder to ask this question properly than it is to display an example of what I'm looking for.
<jsp:useBean id="myId" class="myClass" />
Now in scriptlet code I can access the methods as so:
<% myId.myMethod() %>
OK what I want to do is this:
<% String strId = "myId"; %>
<jsp:useBean id="<%=strId%>" class="myClass" />
<% myClass.strId.myMethod() %> (Yes I know this syntax is incorrect, so I'm looking for the proper syntax)
So basically I need to write some generic code so I can have several instances on myClass with different ids and access them generically based on strId. I know this is a simple one but I'm having a brain fart.
Thanks is advance!

Hey you are right, because the jsp:setProperty does support setting the property that way I figured I could set the useBean id that way.
So busy worrying about how to access it didn't even check to see if the first part was legal.
Thanks for the quick reply.

Similar Messages

  • How to use tag?

    Hey,
    I was working on some examples and I saw one example had used "tag" when creating a table.
    I'm just wondering why and when do you use tag?
    what is is for?

    For an example of how to use tags with (iPhone) table views, take a look at the code in my reply to [How to edit label in custom UITableViewCell?|http://discussions.apple.com/thread.jspa?messageID=11498619&#1 1498619].
    In that example two labels are added to each new cell when it's created in the tableView:cellForRowAtIndexPath: data source method. The OP wants to change the text in one of those labels when its cell is selected by the user, and the code to do that is in the tableView:didSelectRowAtIndexPath: delegate method.
    But how does the delegate code get the address of either label, and how does it tell one label from the other? This problem is solved by using the 'tag' property of each label. Note that the code which creates the labels includes statements to set each of the tags. The left label tag is set to 1, and the right label tag is set to 2. The delegate method then sends the [viewWithTag:|http://developer.apple.com/iphone/library/documentation/UIKit/Ref erence/UIViewClass/UIView/UIView.html#//appleref/doc/uid/TP40006816-CH3-SW26] message to the selected cell. When the integer '1' is passed as the argument, the viewWithTag: method returns the address of the first subview it finds with a tag value of '1'.
    Hope that helps!
    \- Ray
    p.s.: In previous threads my poor vision saw a lower case 'L' in your alias instead of the second 'i'. When I correct that mistake your alias looks more like a form of David. Sorry for the past mistakes. - R

  • How to use tags in workflows to identify mediaType ?

    Hi,
    I have installed sl server on vmware and podcastproducer works great on it. I begun to explore workflows and podcastcomposer.
    This is my first feedback :
    With 10.5, for example I use on blog server : http://myserver/groups/blog/index.rss?mediaTypeTag=ipod&howMany=500&tag=itunes to return feed with only ipod (m4v) media. In this way mediaTypeTag parameter lets me filter feed enclosures.
    With 10.6 I didn't arrive to make the same thing. I tried to add tags in publish step in podcastcomposer, but tags apply on all exports. I try to edit template.plist of workflow to add different tag on each export but it doesn't work. It seems to work only if tags are the same on each export.
    So I tried to use wiki publishing to make it work, but it seems to be impossible to publish to wiki and in the same way apply a wiki tag to the post.
    So neither with export, neither with publish parameter in a workflow I can distinguish media exin the feed. That's a big lack for me.
    Another thing. The lack of Blog server in 10.5 is posts editing. But it seems to be the same thing in SL. It is impossible to edit post date or author name in the wiki or in podcast library. Second thing how could I delete entries in podcastlibrary.
    Thanks for your help.
    Chris

    Hi,
    I have installed sl server on vmware and podcastproducer works great on it. I begun to explore workflows and podcastcomposer.
    This is my first feedback :
    With 10.5, for example I use on blog server : http://myserver/groups/blog/index.rss?mediaTypeTag=ipod&howMany=500&tag=itunes to return feed with only ipod (m4v) media. In this way mediaTypeTag parameter lets me filter feed enclosures.
    With 10.6 I didn't arrive to make the same thing. I tried to add tags in publish step in podcastcomposer, but tags apply on all exports. I try to edit template.plist of workflow to add different tag on each export but it doesn't work. It seems to work only if tags are the same on each export.
    So I tried to use wiki publishing to make it work, but it seems to be impossible to publish to wiki and in the same way apply a wiki tag to the post.
    So neither with export, neither with publish parameter in a workflow I can distinguish media exin the feed. That's a big lack for me.
    Another thing. The lack of Blog server in 10.5 is posts editing. But it seems to be the same thing in SL. It is impossible to edit post date or author name in the wiki or in podcast library. Second thing how could I delete entries in podcastlibrary.
    Thanks for your help.
    Chris

  • How to Use tag in JDeveloper 9i for a JSP Page

    Hi ,
    I am working on JDeveloper 9i. I have a problem that i use JSP page and two tag[b] fmt and core. The uri passed to taglib is http://java.sun.com/jsp/jstl/core and http://java.sun.com/jsp/jstl/fmt. i also have two jar file standard.jar and jstl.jar. when i compile the jsp page, the errors reflect " TAG is not registered". Can any one tell me that how can i use the tags in a jsp page in jdeveloper 9i.
    Thanks

    Hi ,
    I am working on JDeveloper 9i. I have a problem that i use JSP page and two tag[b] fmt and core. The uri passed to taglib is http://java.sun.com/jsp/jstl/core and http://java.sun.com/jsp/jstl/fmt. i also have two jar file standard.jar and jstl.jar. when i compile the jsp page, the errors reflect " TAG is not registered". Can any one tell me that how can i use the tags in a jsp page in jdeveloper 9i.
    Thanks

  • How to use Tag Removal for showDetailsItems in panelbox?

    Hi All,
    I have simple page with some command links.when i click link its renders the showDetails Items in other panelTable.for this i enabled Tag Removal property.
    but in UI when i click on remove(cross mark) i am not able to remove the showdetailsItems.how to do this .can any one please give me solution for the same.
    Thanks in Advanced
    Siva

    yes got it.
    I used some manged bean code and i have set itemListener property of ShowDetailsItem.
    public void staticPanelTabItemListener(ItemEvent itemEvent) {
    if (itemEvent.getType().equals(ItemEvent.Type.remove)) {
    Object item = itemEvent.getSource();
    if (item instanceof RichShowDetailItem) {
    RichShowDetailItem tabItem = (RichShowDetailItem)item;
    tabItem.setVisible(false);
    Thanks
    Siva

  • How to use tags from taglib in jsp

    i am using tomcat. I don't know where the taglibrary is stored i.e in which folder and how can i access that library and use it in the jsp pages.

    Refer to
    http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSPTags4.html
    thanks,
    Deepak

  • How to use tag libraries?

    hi,
    I have an external taglibrary file, bean.tld. I want to use the tags of this file in portal component. Where shall i place this file in order to access it?
    regards,
    ganesh natarajan

    Hi,
    You can get some information from other threads
    Problem Using Taglibs with PortalApplication
    Problems with custom taglib (PD4ML)

  • Custom Tag - how to use tag value= %=jsp% / ?

    Hello friends,
    I am new to custom tags. I have written simple tags that handle value="some hard-coded stuff">.
    But cannot not implement jsp-supplied values? Could you please help with advice?
    Basically, how to implement a custom tag that would allow:
    <mylib:mytag value=<%=somejsp%> />
    Thank you!

    Just define it in your .tld ...
    Example:
    <attribute>
    <name>comments</name>
    <required>false</required>
    //IF this is set to true, u can add your jsp stuff... in your value
    <rtexprvalue>true</rtexprvalue>
    <type>String</type>
    </attibute>
    Usually, the .tld goes in WEB-INF/lib ... some people just put it in WEB-INF/

  • How to use .class with generics

    Okay, in Java 5, Foo.class works just fine. But Map<Foo,Bar>.class does not. What is the right format?
    I am trying to get a field value through reflection:
    public static <T> T readFieldValueCastSave(
       Object target,
       String fieldName,
       Class<T> fieldType)
                   throws Exception{
              T r = null;
              Field f = getField(target.getClass(), fieldName);
              f.setAccessible(true);
              r = fieldType.cast(f.get(target));
              f.setAccessible(false);
              return r;
    }So this method works just fine for something like this:
    class Foo {
       private Bar myBarField;
    Bar b = readFieldValueCastSave(myFooObj, "myBarField", Bar.class);Now, what do I do in this case:
    class Foo {
       private List<Bar> myList;
    List<Bar> l = readFieldValueCastSave(myFooObj, "myList", List<Bar>.class);List<Bar>.class simply does not compile.
    Any suggestions ?

    That's because List<Bar>.class doesn't exist. List.class exists, use that.

  • Strategies for using Tags in Mavericks

    I'm very curious to find out how some of you plan to use Tags in Mavericks (feel free to post screenshots).
    Apple uses generic tags to give people a sense of their purpose:
    While their example works to clarify the basic concept of tagging, I don't think such broad top-level tags as Home, Work, and Travel would suffice if you plan to incorporate tagging into your general workflow.
    I know this is a highly individualized concept and none of you are likely to post a tagging strategy that works perfectly for any other one of us, but I think we could all learn a little something by seeing how others plan to implement tagging.
    Couple of specific questions I have are:
    Do you plan create hundreds of tags, or a more static/refined collection of tags?
    How about using tags to denote level of importance/priority (i.e. tags simply called: 1, 2, 3, 4, 5)
    Does it make sense to group related tags using color labels? (i.e. Assign the color blue to Work related tags such as receipt or invoice, then using the color red to group together tags pertaining to my personal life such as kids, soccer, landscaping).
    Feel free to chime in and answer these questions, or to give a brief explanation of your tagging strategy. Thanks!

    Highly intersted in that, too. Haven't found out how to make them useful.
    The basic issue I see is to search for documents. I can't select more than one tag in order to only show the cut set, e.g. Important + Home.

  • Using tags

    I misunderstand or don't know how to use tags. If I have pictures for a sporting team, for instance, in several directories, I have a tag for the team name and apply the tag to the pictures. When I want to view pictures of the team from all folders, it doesn't work. I have to have a folder selected, as well as the tag. I don't get the point of tags. I have thousands of folders. I presumed the tags would allow me to find any picture with a particular tag, regardless of the containing folder.

    Hello Waldoquaz,
    Maybe you want to have a look into that thread here http://forums.adobe.com/message/5753281#5753281 - your current question is already answered here, but maybe...
    Regards
    Thomas

  • How to use "scope " attrubute in useBean tag

    Can anyone please tell me if I can use the same JavaBean Class to hold information form different pages? well, let me explain exactely what I want to do:
    I have a Java bean Class that holds a property 'Name':
    package ContactManager;
    public class Person {
    private String name="%";
    public String getName () {
    return this.name;
    public void setName (String my_name) {
    name = my_name + "%" ;
    I'm using this class to store temporarly the Criteria of search from a JSP/HTML page to send to a database for search and for UPDATE -> this of course is done in different HTML/JSP pages. The problem I have is that the first time I set the properties (when the user make a search) this value remains unchanged [-> the second time when the user asks for update, I try to use the same bean to keep the value => unfortuntly it returns me the old value]
    My question is: is the use of 'scope' attribute of the "jsp:useBean" tag can solve this problem? if yes how to use it? I've tryed to set the scope of the bean to page but that does not help :-(
    Pleaze help, I'm stuck.... Bellow is the 4 JSP pages for:
    - person_search.jsp / person_result.jsp
    - request_modify.jsp/ DoModify.jsp
    1 -person_search.jsp
    <%@ page import="java.sql.*" %>
    <HTML>
    <HEAD><TITLE>Person Search</TITLE></HEAD>
    <BODY><CENTER>
    <form method="POST" action="person_result.jsp">
    Name <input type="text" name="name" size="47"></p>
    <input type="submit" value="Submit" name="B1">
    <input type="reset" value="Reset" name="B2"></p>
    </form></body>
    </html>
    2- person_result.jsp
    <%@ page import="java.sql.*" %>
    <HTML><BODY>
    <jsp:useBean id="theBean" class="ContactManager.Person"/>
    <jsp:setProperty name="theBean" property="*" />
    Name<BR>
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("JDBC driver loaded");
    catch (ClassNotFoundException e) {
    System.out.println(e.toString());
    %>
    <%
    try {
    Connection con = DriverManager.getConnection("jdbc:odbc:ContactManager");
    Statement s = con.createStatement();
    String sql = "SELECT Client.ClientID, Client.Name FROM Client where Client.Name like " + "'" + theBean.getName() + "'";
    ResultSet rs = s.executeQuery(sql);
    while (rs.next()) {
    String myId = rs.getString(1);
    %>
    <TR>
    <TD><%= myId %></TD>
    <TD><a href="person_detail.jsp?id=<%= myId %>"><%=rs.getString(2)%></a></TD>
    <TD><a href="delete_person.jsp?id=<%= myId %>">Delete</a></TD><BR>
    </TR>
    <%
    rs.close();
    s.close();
    con.close();
    catch (SQLException e) {
    System.out.println(e.toString());
    catch (Exception e) {
    System.out.println(e.toString());
    %>
    </BODY>
    </HTML>
    3- request_modify.jsp
    <%@ page import="java.sql.*" %>
    <html>
    <head><title>AddressBook: Modifying Person <%= request.getParameter ("id") %></title> </head>
    <body bgcolor="#ffffee">
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("JDBC driver loaded");
    catch (ClassNotFoundException e) {
    System.out.println(e.toString());
    %>
    <%
    int rowsAffected = 0;
    try {
    Connection con = DriverManager.getConnection("jdbc:odbc:ContactManager");
    Statement s = con.createStatement();
    String sql = "SELECT Client.ClientID, Client.Name FROM Client where ClientID ="+ request.getParameter("id");
    ResultSet rs = s.executeQuery(sql);
    if (rs.next()) {
    %>
    Client Name is <input type=text name=name value=<%= rs.getString(2) %>> <br>
    <TD><a href="person_do_modify.jsp?id=<%= rs.getString(1)%>">Confirm Modify</a></TD>
    <%
    rs.close();
    s.close();
    con.close();
    catch (SQLException e) {
    System.out.println(e.toString());
    catch (Exception e) {
    System.out.println(e.toString());
    %>
    </BODY> </HTML>
    4- do_modify.jsp
    <%@ page import="java.sql.*" %>
    <html>
    <head><title>AddressBook: Modifying Address <%= request.getParameter ("id") %></title></head>
    <body bgcolor="#ffffee">
    <jsp:useBean id="theBean" class="ContactManager.Person" scope="page"/>
    <jsp:setProperty name="theBean" property="name"/>
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("JDBC driver loaded");
    catch (ClassNotFoundException e) {
    System.out.println(e.toString());
    %>
    <%
    int rowsAffected = 0;
    try {
    Connection con = DriverManager.getConnection("jdbc:odbc:ContactManager");
    PreparedStatement preparedStatement = con.prepareStatement ("UPDATE Client SET Name=? WHERE ClientID =?");
    preparedStatement.setString (1, theBean.getName());
    preparedStatement.setString (2, request.getParameter("id"));
    rowsAffected = preparedStatement.executeUpdate ();
    preparedStatement.close ();
    if (rowsAffected == 1) {
    %>
    done
    <%
    else{
    %>
    Not Modified
    <%
    con.close();
    catch (SQLException e) {
    System.out.println(e.toString());
    catch (Exception e) {
    %>
    </BODY></HTML>
    Thank you for the help.
    Sammy

    While a quick search on the <jsp:useBean> tag and the scope attribute will probably yield more information than I can summarize in a few sentences, I'm pretty sure that using the scope="page" attribute on a bean will cause that bean to be instantiated every time the page is loaded. In order for a bean to persist longer than the existance of that page (whether you're loading a new page, or reloading the same one), you'd need to set the scope to session or application (you'd probably want session).

  • How to use Microsoft Word's Find and Replace with HTML tags?

    Hello to all!
    I'm trying to figure out how to use the find and replace function in Word to replace html tags. I'd like to be able to change something like this:
    <span class="B01-K-ITAL">random text</span>
    To something like this:
    <em>random text</em>
    I want to replace the open and close tags without changing or interfering with the text between the tags. I'm pretty sure I should use wildcards, but I can't figure out how to use them properly.
    Anyone able to lend a hand?

    Here is my latest regular expression with Perl.   I think it matches the spirit of the request in the original post.
    Note, this isn't as easy as you think.  You need to code up the complete set of html rules in you implementation. You need to allow for a certain amount of mal-formed html.
    perl -0660pe 's^<[sS][pP][aA][nN]\s+class="B01-K-ITAL"\s*>(.*?)</[sS][pP][aA][nN]>^<em>$1</em>^gs' i.html >|o.html
    input text
     <html> <head>...</head> <body>I'd like to be able to change something like this: <span class="B01-K-ITAL">#1 one line</span> I want to replace the open and close tags without changing or interfering with the text between the tags. I'm pretty sure I should use wildcards, but I can't figure out how to use them properly. <p>note, this isn't as easy as you think.  You need to code up the complete set of html rules in you implementation. You need to allow for a certain amount of mal-formed html.</p> <span class="B01-K-ITAL">#2 don't be greedy</span> <span class="B01-K-ITAL">$3 multiline text</span> <span class="B01-K-ITAL">#4 multiline tag. I believe html allow a carriage return in white space of tags</span> <span class="B01-K-ITAL">#5 split after the class tag. optional white space</span> <sPan class="B01-K-ITAL">#6 mixed case tag</Span> <p>no text #7</p><span class="B01-K-ITAL"></span> <!-- Apparently, this is valid     http://www.positioniseverything.net/articles/cc-plus.html --> <!--[if IE]> <div id="IEroot"> <![endif]--> <p id="IE">This browser is IE.</p> <p id="notIE">This browser is not IE.</p><!--[if IE]> </div> <![endif]--></body> </html>
    output text
     <html> <head>...</head> <body>I'd like to be able to change something like this: <em>#1 one line</em> I want to replace the open and close tags without changing or interfering with the text between the tags. I'm pretty sure I should use wildcards, but I can't figure out how to use them properly. <p>note, this isn't as easy as you think.  You need to code up the complete set of html rules in you implementation. You need to allow for a certain amount of mal-formed html.</p> <em>#2 don't be greedy</em> <em>$3 multiline text</em> <em>#4 multiline tag. I believe html allow a carriage return in white space of tags</em> <em>#5 split after the class tag. optional white space</em> <em>#6 mixed case tag</em> <p>no text #7</p><em></em> <!-- Apparently, this is valid     http://www.positioniseverything.net/articles/cc-plus.html --> <!--[if IE]> <div id="IEroot"> <![endif]--> <p id="IE">This browser is IE.</p> <p id="notIE">This browser is not IE.</p><!--[if IE]> </div> <![endif]--></body> </html>

  • How to use multiple Apple IDS

    I just bought my first iPhone and another one for my wife.  I'm trying to figure out how to configure Apple IDs to get the most out of our phones.  I'm interested in having us both share contacts and calendars, as well as use the same account for iTunes and the app store.  But we'd like to be able to FaceTime each other.  Is it possible to have one Apple ID for contacts, calendars, iTunes and apps, while use a different one for FaceTime?
    In addition, my wife and I run a small business together, and it makes sense to me to use a separate Apple ID for this so that we can keep business contacts and schedules separate.. allowing us to use this same business ID for other office/managerial employees in the near future.  There are also another set of apps for the business... for example, we use Google Voice in our business.  Can we use another Apple ID for another set of contacts and calendar appointments?

    YOu can share apple id for apps and music.
    However you should get a separate id for imessage/facetime/icloud.

  • How to use the Wire-Tag in Cairngorm 3 Observer Library?

    Dear Observer-Lib coders,
    Maybe I am posting my issue into the wrong forum, see this thread:
    http://forums.adobe.com/thread/756046
    I'd like to know how to use the Wire-Tag mentioned in the Observer-Lib docu, see:
    http://sourceforge.net/adobe/cairngorm/wiki/HowToUseCairngormObserver/
    Please let me know if there is anybody who knows how to use
    this Wire-tag. A small code example would be great, too!
    Thank you,
    masu

    Ok ... I solved it!
    see this thread: http://forums.adobe.com/thread/756046

Maybe you are looking for

  • Exception in XML Parsing:Premature End of file.

    Hii I am geting exception in XML pasing in following line doc=parser.parse(new File(sFileName)); if any one kno about this then plz send me solution and reason of this exception. Thanks

  • How to setup outlook on my laptop

    How do I set up outlook on my laptop so I can view my 2me.com mail?

  • Save scalar ascii data to columns

    Hello, I have created a signal express project (signalexpress 2.0) that creates 60 second averages of data coming in over an NI USB-6251.  It runs through a conditional repeat of aquire steps until a generated signal (time) reaches 60 seconds.  This

  • Transfer of Assets (IDOCS)

    Hi, I am trying to transfer Assets between two SAP machines. I would like to know if it is possible to do so by using IDOCS. Thanks, Luis

  • JSP mapping in Tomcat

    I've a directory structure in Tomcat that looks like : TOMCAT_HOME\webapps\Security\jsp\ Guys I need help on JSP mapping. I'm running Tomcat and I want all the /Security/*.jsp requests in Browser goto above context. i.e. http://localhost/Security/AJS