Struts tag question

I am writing a web app that uses Struts and the associated tag libs in the JSP. I am trying to create a form with three text fields, each of which will be initialized to a value from a bean referenced in the top of the JSP. When I try the following, I get an exception saying the value must be followed by a ". How can I do this?
<html:form action="screens/UpdateName.do">
<table>
<tr><td> First: </td>
<td> <html:text property="firstName" size="22" maxlength="22" value=<%= Customer.getFirstName();%>/>
</td>
</tr>
<tr><td> Middle: </td>
<td> <html:text property="middleName" size="22" maxlength="22"/>
</td>
</tr>
<tr><td> Last: </td>
<td> <html:text property="lastName" size="22" maxlength="22"/>
</td>
</tr>
     <tr><td colspan="2">
<html:submit property="submit" value="Enter"/>
</input>
</td>
     </tr>
</table>
</html:form>
Customer is the name of the bean with the name data in it.

You don't need the value attribute for this tag. The property attribute will ensure that the text field gets the value from the Customer bean firstName property.
You would use the value attribute if you weren't specifiying a property.
Dave

Similar Messages

  • Help me for a basic Struts tag question.

    I need display a image on my page, but I don't know how to replace
    "?" in <html:img src="?" /> with one of my bean's property.
    My teacher asked us must not use any <%..%> style expressions
    Please help me do it.
    Thanks

    ok - too early - what I mean to say is, scratch the bean:write, I didn't read very clearly, use your html:img but use the property attribute, not the src attribute.
    Sorry for the confusion
    Lee

  • Struts tag for request.setAttribute() in a jsp page

    Hello All
    Does anyone know struts tag that can be used for request.setAttribute() in a jsp page?
    Thanx in advance.

    Well
    <bean:define id="foo" name="newsIdAttribute" scope="request" type="java.lang.String" />is equivalent to
    <%
    (java.lang.String) foo = (java.lang.String)request.getAttribute("newsIdAttribute");
    %for setting bean properties you might have to use
    <jsp:setProperty/> or <c:set/> tags in JSP / JSTL respectively.
    Hope this might answer your question :)
    REGARDS,
    RaHuL

  • JDeveloper editing JSP with Struts tags terribly, terribly slow!?

    I use JDeveloper 10.1.2 and I do not know the reason but it started to take 15min just to change/edit JSP containing Struts tags. RAM memory is 1GB and there is more than 0.5 GB available, but processor usage shows 100% allocated to JDeveloper!? As soon as I do even slight change in a JSP file JDeveloper starts some computations and I have no idea of what it is doing.
    What is JDeveloper computing? It seems it tries to produce some drop-down lists "helping" me to do the editing, add tags and instead I am spending days to just change one small JSP page!
    How can I stop and PREVENT JDeveloper doing ANY "help" during editing of ANY file?
    There must be an option to switch off whatever JDeveloper is doing?
    Many thanks,

    I did that but it is still very slow, it looks like Jdev is doing some intensive calculations whenever I click somewhere on JSP page with tags. Maybe this is related with my other question I posted before this one? Maybe JDev automatically searches for tag libraries it cannot find and copies them to /WEB-INF directory? (other IDEs used in same environment, like Eclipse and IntelliJ, and they do not have this problem)
    Some other strange things: struts-config.xml seems not integrated with CVS from JDev (other files like tiles-config.xml, web.xml etc. are integrated, I can right click and get CVS info on particular file, except struts-config.xml). When I want to check in/out struts-config.xml I have to do it with external tool like WinCVS etc., cannot do that from JDev!

  • How to prepare Custom tag with scope as  session  like Struts tag

    Hi
    All Struts tags having the feature of Automatic Scoping.
    Automatic Scoping: Struts tags check all contexts (namely page, request, session, application) and use the first instance found. Developers do not have to explicitly "retrieve" objects from a particular scope. They may, however, specify a context.
    same as like struts tag I want to preapre 'select custom tag'.which will retrieve its previous selected value automatically and display.And one important thing is I dont want to set the selected value of custom tag in session expicitly.I mean the custom tag it self should take care to set the session vale and retrieve the sesion value and display like Struts tag . For struts select tag we wont set any selected value in session though it will retrieve the previous value and display when scope of form = session
    regards
    jagan

    Hi
    All Struts tags having the feature of Automatic Scoping.
    Automatic Scoping: Struts tags check all contexts (namely page, request, session, application) and use the first instance found. Developers do not have to explicitly "retrieve" objects from a particular scope. They may, however, specify a context.
    same as like struts tag I want to preapre 'select custom tag'.which will retrieve its previous selected value automatically and display.And one important thing is I dont want to set the selected value of custom tag in session expicitly.I mean the custom tag it self should take care to set the session vale and retrieve the sesion value and display like Struts tag . For struts select tag we wont set any selected value in session though it will retrieve the previous value and display when scope of form = session
    regards
    jagan

  • Passing struts-tag value to java / javascript variable in JSP

    Hello all,
    Im trying to pass the value got from the struts-tag to the java variable in the Jsp. However Im not able to get the o/p. Can u guys help me on this pls...
    <logic:notEmpty name="TreeBean" property="list">
        <logic:iterate id="Type" name="TreeBean" property="list" indexId="i">
         <br/><bean:write name="Type" />
        </logic:iterate>
    </logic:notEmpty>Here the list can be populated in the jsp page. However i want the values into jsp list. Im not able to populate the same..
    <% List jspList = null;
    %> I want the values into the jspList variable for further processing. Can u guz pls help me on this....

    Which do you want it in?
    A java variable for use in <% scriptlet code %> or a javascript variable for use on the client end?
    scriptlet:
    <jsp:useBean id="TreeBean" type="java.util.List" class="java.util.ArrayList" scope="?????" />
    Having scriptlet code on the page is considered bad coding style.
    What is it you are trying to accomplish by making the value accessible?
    What are you trying to do in java / javascript that can't be done with JSP tags?

  • Struts tag problems in weblogic 5.1 sp12

              Hello,
              I am deploying a struts application in weblogic 5.1 sp 12. When I load any jsp
              page with a struts tag, e.g. <html:html>, it will throw exceptions as follows:
              Parsing of JSP File '/Feedback.jsp' failed:
              /Feedback.jsp(-1): Error in tag library at: 'bean': error introspecting class:
              'org.apache.struts.taglib.bean.CookieTag': weblogic.servlet.jsp.JspException:
              (line -1): Error in tag library at: 'bean': class org.apache.struts.taglib.bean.CookieTag
              doesn't implement javax.servlet.jsp.tagext.Tag
              probably occurred due to an error in /Feedback.jsp line -1:
              any comment is highly appreciated! I am following the directions posted on apache
              website about instaling struts with weblogic 5.1.
              

              Hello,
              I am deploying a struts application in weblogic 5.1 sp 12. When I load any jsp
              page with a struts tag, e.g. <html:html>, it will throw exceptions as follows:
              Parsing of JSP File '/Feedback.jsp' failed:
              /Feedback.jsp(-1): Error in tag library at: 'bean': error introspecting class:
              'org.apache.struts.taglib.bean.CookieTag': weblogic.servlet.jsp.JspException:
              (line -1): Error in tag library at: 'bean': class org.apache.struts.taglib.bean.CookieTag
              doesn't implement javax.servlet.jsp.tagext.Tag
              probably occurred due to an error in /Feedback.jsp line -1:
              any comment is highly appreciated! I am following the directions posted on apache
              website about instaling struts with weblogic 5.1.
              

  • Problem compling JSP with struts tags on Weblogic 8.1

    I have deployed a web application in Weblogic 8.1. However, I am facing a problem while the JSPs are getting compiled. The JSPs ahve taglib declarations referring to Struts tag library files that are present in WEB-INF folder.
    Stacktrace:
    C:\java\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_epgonline_epgonline\jsp_servlet\_approve\__approve_home.java:209: cannot resolve symbol
    probably occurred due to an error in /approve/approve_home.jsp line 53:
    <logic:notPresent name="<%=JobBean.ID%>" scope="request">
    C:\java\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_epgonline_epgonline\jsp_servlet\_approve\__approve_home.java:209: cannot resolve symbol
    symbol : variable EVAL_BODY_BUFFERED
    location: interface javax.servlet.jsp.tagext.BodyTag
    if (_int0 == BodyTag.EVAL_BODY_BUFFERED) { //[ /approve/approve_home.jsp; Line: 53]
    I believe other people have also faced this issue with Weblogic8.1 and struts. Any solutions???
    Thx
    KP

    KP,
    Does this code run in the development environment but not in production? How
    was this code compiled?
    - john
    "KP" <[email protected]> wrote in message
    news:405b9b56$[email protected]..
    I have deployed a web application in Weblogic 8.1. However, I am facing aproblem while the JSPs are getting compiled. The JSPs ahve taglib
    declarations referring to Struts tag library files that are present in
    WEB-INF folder.
    Stacktrace:
    C:\java\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\m
    yserver_epgonline_epgonline\jsp_servlet\_approve\__approve_home.java:209:
    cannot resolve symbol
    probably occurred due to an error in /approve/approve_home.jsp line 53:
    <logic:notPresent name="<%=JobBean.ID%>" scope="request">
    C:\java\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\m
    yserver_epgonline_epgonline\jsp_servlet\_approve\__approve_home.java:209:
    cannot resolve symbol
    symbol : variable EVAL_BODY_BUFFERED
    location: interface javax.servlet.jsp.tagext.BodyTag
    if (_int0 == BodyTag.EVAL_BODY_BUFFERED) { //[/approve/approve_home.jsp; Line: 53]
    >
    I believe other people have also faced this issue with Weblogic8.1 andstruts. Any solutions???
    >
    Thx
    KP

  • Struts tags

    Hi there
    I am new to struts. I was trying to test a logon system, and I got some problems with invoking struts tags.
    I created "pages" fold and "tags" fold under my WEB-INF fold. I copied and pasted all tlds in tags fold including struts-html.tld. In pages fold, there is a Logon.jsp, which has <%@ taglib uri="/tags/struts-html" prefix="html" %> at the top.
    However, the system gives me an error message below
    File "/tags/struts-html" not found
    If I change it to <%@ taglib uri="/tags/struts-html.tld" prefix="html" %>, the errors becomes to
    java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TageAttributeInfo.<init>(Ljava/lang/...................
    Does anyon know how to fix it?
    Cheers
    Weiming Chen

    Hi there
    I am new to struts. I was trying to test a logon
    system, and I got some problems with invoking struts
    tags.
    I created "pages" fold and "tags" fold under my
    WEB-INF fold. I copied and pasted all tlds in tags
    fold including struts-html.tld. In pages fold, there
    is a Logon.jsp, which has <%@ taglib
    uri="/tags/struts-html" prefix="html" %> at the top.
    However, the system gives me an error message below
    File "/tags/struts-html" not found
    If I change it to <%@ taglib
    uri="/tags/struts-html.tld" prefix="html" %>, the
    errors becomes to
    java.lang.NoSuchMethodError:
    javax.servlet.jsp.tagext.TageAttributeInfo.<init>(Lja
    a/lang/...................
    Does anyon know how to fix it?
    Cheers
    Weiming ChenDear Weiming Chen,
    Try this,
    <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic"%>
    ..........

  • How to get parameter and add it to hyperlink using struts tag?

    Hi everyone:
    There is a.jsp pass a parameter to b.jsp.How to get the parameter in b.jsp using struts Tag?I also want to add the parameter to a hyperlink in b.jsp.For example in b.jsp <html:link forward=.....>cxxxx</html:link>.How to add the parameter(get from a.jsp) to cXXXX in b.jsp?

    Try this:
    Copy A Request Parameter - You can create a new bean containing the value of a parameter included in this request. If no parameter of the specified name was included, a request time exception will be thrown - therefore, it is common to nest the use of this tag inside a <logic:present parameter="xxx"> tag to ensure that the parameter was really included. If there is the possibility that more than one parameter of the same name was included, specify the "multiple" attribute (and the resulting value bean will be an array of String values, instead of a single String).
    <bean:parameter id="name" name="name"/>
    And then just use <html:link> with paramId. No java code at all.

  • Struts tags preferences

    is there a preference file for Struts tags such that the HTML code it generates can be customized? For example I have the following Struts tag code:
    <s:form
         action="upload" method="POST" enctype="multipart/form-data">
         <s:file name="upload" label="File" />
         <s:submit id="upload" name="submit"/>
    </s:form>and the HTML it generates automatically put everything into tables. What annoys me is that the Submit button is placed in its own row. Why?? The form looks frickin' ugly now.
    <form id="upload" name="upload" onsubmit="return true;" action="upload.action" method="POST" enctype="multipart/form-data"><table class="wwFormTable">
         <tr>
        <td class="tdLabel"><label for="upload_upload" class="label">File:</label></td>
        <td
    <input type="file" name="upload" value="upload_upload" =""/></td> </tr>
         <tr>
        <td colspan="2"><div align="right"><input type="submit" id="uploadIcon" name="submit" value="Submit" />
    </div></td>
    </tr>
    </table></form> Is there a solution to customize this? thank you

    Maybe just don't use the struts tag then?

  • Struts tag library instead of JSTL

    My developers here are not very well versed with JSTL .
    Is it advisable to use the Struts tag library instead of JSTL.

    For JSTL you need two jar files in your web-inf/lib directory.
    standard.jar
    jstl.jar
    You only mentioned standard.jar - make sure the other is there as well.
    There are also some libraries requried. I think they were included with JDK1.4, but am not entirely certain.
    Check out the requirements on this page:
    http://jakarta.apache.org/taglibs/doc/standard-1.0-doc/standard-1.0/GettingStarted.html
    Particularly those related to JAXP.
    I am think EOFException might be a trouble with parsing the c.tld file in the standard.jar
    Hope this helps,
    evnafets

  • Struts Interview questions

    Send Struts interview question in my mail id [email protected]

    send me struts interview questionsDumb idiots. Couldn't you read the thread?another racist?!?Another idiot. Spamming fora again?!?Sorry Maris not here now please try again later.No thanks. I'm tired os talking nonsense. :(Sorry. :(
    You do know that despite any other commentary over time this thread will balloon to 100's of posts just like 2 and 4 though right?
    <crawling behind rock again/>

  • PDK Struts tags

    When trying to use the PDK Struts tags in a portlet, I receive the following error message when the portlet has been deployed to a 10g portal:
    [ServletException in:/WEB-INF/jsp/tiles/portal/index.jsp] action'
    Even with debug mode enabled on the server, that's the only detail I get. My config is as follows:
    IN SERVER.XML
    <taglib>
    <taglib-uri>/WEB-INF/tld/pdk-struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/tld/pdk-struts-html.tld</taglib-location>
    </taglib>
    IN THE TAGLIB INCLUDE
    <%@ taglib uri='/WEB-INF/tld/pdk-struts-html.tld' prefix='pdk' %>
    IN THE JSP:
    <pdk:link page="/servlet/letterView">Link text</pdk:link>
    VERIFIED:
    - The portlet works without the tag included.
    - It works using the standard Struts html:link tag, but of course generates the resulting page in it's own screen, outside of the portal container
    - The TLD is indeed in the location listed in the URI
    - The following two JARs are included in the LIB directory: pdkjava.jar, pdkstruts.jar
    - I removed all attributes from the tag and received a more detailed message (Cannot create rewrite URL: java.net.MalformedURLException: You must specify exactly one of "forward", "href", or "page"') so it seems like everything that needs to be in place is indeed in place -- it seems like I'm just misusing the tag.
    Any help would be appreciated. Thanks!

    The problem was an old copy of the struts.jar file, which was missing the calculateUrl() method called by the Oracle tag. With a new struts.jar file, all was good.

  • Strut tags

    Any reasons why struts tags don't get processed? Here is the code placed in a JSP:
    <html:form action="/commitcancel">
    <html:hidden property="billOrderMaterial" value="<%=request.getParameter("billOrderMaterial")%>"/>
         <html:hidden property="useCurrent" value="<%=request.getParameter("useCurrent")%>"/>
         <html:hidden property="processType" value="<%=request.getParameter("processType")%>"/>
    <%String processType=request.getParameter("processType");
    if(processType != null & processType.equalsIgnoreCase("cancelreq")) { %>
    <html:submit styleClass="button" value="Cancel"/>
    <% }
    %>
    </html:form>

    check whether your application is still supporting jsp1.0?
    if so change it to support jsp1.1
    Regards
    Ramesh Kesavanarayanan

Maybe you are looking for

  • JavaMail application hanged with no error throwed at Transport.send

    JavaMail application hanged with no error throwed at Transport.send,even though I set the timeout property import java.util.Date; import java.util.Properties; import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.PasswordAuthe

  • Google map in internet explorer

    anybody out there that can help me embed a google map using dreamweaver cs4 that will display correctly in internet explorer? or any map for that matter! Running dreamweaver cs4 on a G5 imac

  • How can I get rid of search.babylon in my address bar, I have tried everything?

    when I open firefox, in the address bar comes search.babylon.com I have tried everything to get rid of it and can't. Please help

  • Error Running Oracle forms

    I have Oracle 8i with developer 6i installed on a win-xp professional(sp1) system. when i try to run my developed application thru an icon from the desktop it creates a file by name ifrun60_dump_47244 (the no changes every time i try to do) and this

  • Is there a Data Model in BW for Financial Reporting?

    Hi, I am required to integrate a non-SAP Financial application to SAP BW. I am wondering if there exists a Data Model in SAP BW that supports out of the box canned reports. This will help me target the interface design to feed the existing Data Model