Struts tag bean:message in jsp

Hi
I used
<bean:message key="inputform.username" property="username"/>
in my jsp page to access value using this key from resource bundle.
While requesting the page the error is showing that----
javax.servlet.ServletException: Missing message for key "inputform.username"
Please help me in this problem
Thanks in advance
Sudheesh

I've tried with <bean:write... but since I catch exception saying MyActionForm can't be found in any scope. As far as I'm aware I've set request scope like:
<action input="/jsp/something.jsp" name="MyActionForm" path="/jsp/myAction" scope="request" type="sth.MyAction">
<forward name="success" path="/jsp/index.jsp"/>
<forward name="failure" path="/jsp/something.jsp"/>
</action>
Edited by: D.A.R. on Sep 26, 2007 12:09 PM

Similar Messages

  • bean:message in JSP

    Hi
    i used
    <bean:message key="inputform.username" property="username">
    in my jsp to access the value using key from a resource bundle=--
    While executing the error is showing that
    javax.servlet.jsp.JspException: Missing message for key "inputform.username"
    But i given this application.properties..
    Please Help me
    Regards
    Sudheesh

    java.lang.NullPointerException
    at
    weblogic.ejb20.internal.EJBRuntimeUtils.throwRemoteExc
    eption(EJBRuntimeUtils.java:103)-- Error : In
    companyRoleAddAction.doRoleAdd():Why don't you check the line where this piece of code is generating null pointer :)
    Regards,
    $ Carol.

  • Using EL variable in struts bean:message tag(not struts EL tag)

    Is there any work around to use an EL variable inside struts bean:message tag as key:
    I have like this:
    <bean:message key="${bean.keyName}"/>
    which is throwing error , I know this can be resolved by using struts-el tags but i cannot use them for specific reasons.
    I dont want to use bean:define tag to define my 'bean' and then use like this:
    <bean:message key="<%=bean.getKeyName%>"/> (this actually works, but i want to use EL variable)
    Is there any work around to use EL variable and make the message display on the jsp.
    i tried multiple ways like scriplets and jsp:useBean but nothing worked, Please let me know..
    Thanks in advance

    Im pretty sure that EL does not work in the normal struts tag unless its struts-el tag.Have you tried it?
    As I said, in a properly configured JSP2.0 container you can use EL expressions anywhere you could traditionally use a standard runtime expression <%= expr %>.
    What server are you using? What JSP version?
    The Struts-el tags were written so that you could use EL with struts in JSP1.2 containers.
    The c_rt tags were written so you could use runtime expressions with JSTL tags in JSP1.2 containers. Their use was discouraged even then. Now I consider their use absolutely unnecessary.
    Please read this thread: http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0
    Cheers,
    evnafets

  • bean:message/ tag is not working in tiles:insertAttribute/

    I have a bean:message tag inside my tiles:insertAttribute as shown below.
    <tiles:insertAttribute name='<bean:message="user.menu"/>'/>But <bean:message/> is not getting the value from resource bundle, my resource bundle is in correct place. If i hard code the value then it s working fine.
    How to make it work? Any help?

    sunish_jose wrote:
    <tiles:insertAttribute><bean:message="user.menu"/></tiles:insertAttribute>this way it s not working. Could you pls tell how solve it by using EL. I was not able to find a similar sample evenafter searching for some time.
    thanks in advance.I did say that I don't know if it will or not, I was just giving a sample of how it would work if the tag allowed the value for 'name' to be put in the body.
    I'm not very familiar with the Struts bean tags and in any case, I believe you should use the JSTL tags where ever possible. So you'd pick the <fmt:message> tag from there. I don't think the <bean:message> tag allows you to get the value in to a variable.
    <fmt:message var="tilesAttributeNameValue" key="user.menu" />
    //create an EL variable named tilesAttributeNameValue with the value from the resource bundle
    <tiles:insertAttribute name="${tilesAttributeNameValue}"></tiles:insertAttribute>
    //use EL to put the valueTake a look here [1] for a JSTL introduction:
    [1] http://www.ibm.com/developerworks/java/library/j-jstl0415/

  • 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?

  • 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

  • How to call the form bean value on jsp withthe help of jstl tag

    hi
    all friends
    i am working in struts & i use jstl tag in jsp. i have one problem rise is how to call the form bean value in jsp page by using jstl tag.
    i now how to retrive the value through jsp:logic
    eg. <logic:empty name="userListForm" property="users">
    NO USER FOUND
    </logic:empty>
    see * userListForm mean formbaen name.
    * users means collection object.
    so how can i write above e.g in jstl

    You use the jstl core:if or core:choose combined with the EL:
    <c:if test="${empty users.userListForm}">
    NO USERS FOUND
    </c:if>I suggest you lookup the jsp expression language (EL) using google, it's very powerful.

  • 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

  • Struts Framewrok -- Bean Tag Problem

    Hi all,
    When i want to print uNews.getBody(); (uNews is a bean in request) in my jsp i use this tag,
    <bean:write name="uNews" property="body"/>
    but how can i use this method for writing something like this:
    uNews.getReporter().getID(); that way, using been:write tag, what i already do is:
    <%
              UnapprovedNews uNews = (UnapprovedNews) request.getAttribute("uNews");
              out.println (uNews.getReporter().getUserID());
    %>
    How can i use the struts tags instead of this code?
    Best Regards
    Ehsan

    try this:-
    <bean:define id="reporter" name="uNews" property="reporter"/>
    <bean:write name="reporter" property="userID"/>
    Sumanta Mandal
    ([email protected])

  • Struts bean:message encoding help

    Hello, i am using Struts framework and have problems with resource files.
    I have two files for english and lithuanian.
    jsp file:
    <%@ page contentType="text/html; charset=Cp1257" pageEncoding="Cp1257"%>
    Developed by: <bean:message key="developer.name"/>
    So its echo bad string.
    Any ideas?

    I have had same problem but I have resolve it by both changing the encoding property of IDE(mine is NetBeans 3.6) to UTF-8 and
    put the line
    <%@page pageEncoding="UTF-8"  contentType="text/html; charset=UTF-8" %>on the top of jsp pages.
    But now I having some problems with formbean I hope I resolve it.
    You can follow it from here
    http://forum.java.sun.com/thread.jspa?threadID=698855

  • Send message from JSP page to Java message driven bean

    Hi all
    I'm using Jdev903.
    I need to send a message from JSP page (Web Application) to Java Message Driven Bean.
    * I created Message Driven Bean that named: MyMessageDrivenEJBBean
    * I have configed jms.xml:
    <topic-connection-factory name="ChatTopicConnectionFactory" location="jms/theTopicConnectionFactory"/>
    <topic name="ChatTopic" location="jms/theTopic"/>
    * In JSP page, my code is:
    final Context ctx = new InitialContext();
    // 1: Lookup ConnectionFactory via JNDI
    TopicConnectionFactory factory =(TopicConnectionFactory)ctx.lookup("jms/theTopicConnectionFactory");
    But trouble occurs is:
    javax.naming.NameNotFoundException: jms/theTopicConnectionFactory not found
    please help me!
    thank a lot.

    Welcome to the Sun forums.
    1. Please post your code using code tags, this formats it so that it is easier for people to read and understand it. Click on 'CODE' above the text area when posting.
    2. As far as possible, please post an SSCCE
    What have learnt about JSPs and servlets till now? Because reading the values submitted in a form is pretty much the base of all operations. I suggest you Google for [servlet tutorials|http://www.google.com/search?q=servlet+tutorial] and [JSP tutorials|http://www.google.com/search?q=jsp+tutorial] and go through them thoroughly. After you understand what is to be done and what options are available to you, if you still face problems, please feel free to post your queries here. But this isn't exactly a site for tutorials, especially since there are so many good ones already out there, that explain all this stuff in detail. There's no point in re-inventing the wheel.
    Hints: [ServletRequest#getParameter()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)] and [RequestDispatcher#forward|http://java.sun.com/javaee/5/docs/api/javax/servlet/RequestDispatcher.html]

  • Bean:message tag

    hi
    sup i wanna use bean:message tag for the image file which is definrd in properties file
    <img align="top" src="/assets/images/common/buttons/bt_bl_continue_v1_en.gif" border="0" style="vertical-align:top; _vertical-align:middle;"></a>
    like
    <bean:message key="com.something.continue_img">
    then how shud i provide the formatting to it like style etc

    All you need do is put the <bean:message> tag as the src attribute.
    In the message bundle the message is the file name to load.
    <img align="top" src="<bean:message key="com.something.continue_img">
    " border="0" style="vertical-align:top; _vertical-align:middle;"></a>

  • Referencing beans as bean attributes in struts tags

    Do struts tags allow you access bean attributes when the bean itself is an attribute of another bean?
    If so, what would be the syntax?
    For instance, I have bean A that contains as an attribute another bean B. I want to test for the value of
    an attribute within B. Let's say I have bean A where A has get/set methods for B and B has get/set methods for an attribute called 'amount'. Then can I say something like:
    <logic:equal name="A" property="B.amount" value="1">
    I tried this syntax and also "B.getAmount()", but neither seems to work.
    I have also tried <logic:equal name="A.B" property="amount" value="1">
    but this doesn't work either.

    I've used that x.y syntax before in some tags, but I don't know if logic tags support it... you should be able to do this:
    <bean:define id="B" name="A" property="B" />
    <logic:equal name="B" property="amount" value="1">

  • 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!

  • Help: OJSPC can not compile the JSP with struts tag

    Hi,
    I am trying to precompile the JSP page with EAR package but OJSPC can not parse the Struts tags.
    I always get oracle.jsp.parse.JspParseException:
    Error: org.apache.struts.taglib.html.MessgesTei while reading TLD /WEB-INF/tld/struts-html.tld
    My OC4J version is 10.1.3.2 and I did tried putting the struts-taglib.jar to /opt/oracle/product/app10g/j2ee/home/jsp/lib or /lib/taglib
    but still do not work.
    Can anyone tell me how to configure the OJSPC and let it support customerized taglibs?
    Thanks a lot!

    This is a new problem with jdk1.4 when compiling with tomcat.
    The solution is to ensure that any classes in WEB-INF/classes are in a package structure and the relevant jsp calls the same using the package name.
    best
    kev

Maybe you are looking for

  • Is there a workaround for iPhone keyboard?

    I absolutely, absolutely hate it. But I love everything else. What am I to do? Go back to Blackberry like so many others who are fed up with the iPhone keyboard? I can't go that far. So I'm hoping someone can direct me to something that makes this ke

  • Video too wide

    I recently took some videos with my friends iphone 4 and my new ipod touch. The video is a mixture of upright and horizontal but some of the videos seem to be wider than they should be. I've changed the aspect ratio but it does not seem to help. Than

  • My Ipod went into recovery mode and my games are gone, how do i get them back?

    My ipod went into recovery mode and restored. How do i get my games back on itunes and everything? Please help!

  • Cannot import package org.apache.catalina in Tomcat 4.1

    Hi, Don't know why I cannot import org.apache.catalina.realm.RealmBase.*; or org.apache.catalina.*; but no problem in importing org.apache.*; ? error prompts "package org.apache.catalina.realm.RealmBase does not exist " Thanks. Jackie

  • Process chains always cancelled directly

    Holá Gurus, while executing a process chains, it is always cancelled directly. The log shows the following message: Process ABAP, variant /SIE/RT_PV_CLOSE_REQUEST_EFC is not scheduled waiting for event RSPROCESS 44IM3WWNHW3Q6IAMA88TS086H Message no.