Bean value storing to varable:
I want to assign the bean value to a variable can it be done:
<% int age = <bean:write property="age"/> ; %>
I want to store that value returned by the bean:write into a local variable so that i can pass it to a script ..
eg:
<logic:iterate name="resourceRequirementForm" property="grades" id="grade" indexId="index">
str varname='<bean:write name="grade" property="value"/>';
</logic:iterate>
can this be done: storing of value i a variable
Similar Messages
-
Bean Value display in JSP Page
Hi,
I am trying to display a value stored in my bean on the jsp page. The value is to be displayed on the initial jsp page.
public void doInitialization()
request = (IPortalComponentRequest) this.getRequest();
response = (IPortalComponentResponse) this.getResponse();
myContext = request.getComponentContext();
myProfile = myContext.getProfile();
Statement += "doInitialization";
BeanContainer = new MockUpBean();
BeanContainer.setValues( Statement);
myProfile.putValue( "myBean", BeanContainer);
// reset String
BeanContainer = ( MockUpBean) myProfile.getValue( "myBean");
}// public void doInitialization()
On the JSP Page side:
<jsp:useBean id="myBean" scope="application" class="MockUpBeanPackage.MockUpBean" />
<%= myBean.getValues()%>
The jsp page does no pick up the value I try to store in the doInitialise method.
Any thoughts on what I may have done wrong in my code.
I try response.write("Test"), this too does not show up in my JSP page.
Any advice would be appreciated.
Thank you
NACMarty,
The portalapp.xml file is as follows:
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
</application-config>
<components>
<component name="MockUpPage">
<component-config>
<property name="ClassName" value="MockUpPackage.MockUpPage"/>
<property name="SecurityZone" value="MockUpPackage/low_safety"/>
<property name="ComponentType" value="jspnative"/>
<property name="JSP" value="pagelet/InitialPage.jsp"/>
</component-config>
<component-profile>
<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
</component-profile>
</component>
</components>
<services/>
</application>
Again any help would be apreciated. I have used this piece of code to write values to beans in various projects, never had any issues. This is the first time I am having an issue with this piece of code.
NAC -
ADF BC how to access session backing bean value in servlet
Hi everyone,
How do I access session backing bean value in a servlet?Frank, thanks for your reply.
I'm not sure how I can incorporate this example into my situation. Let me explain more detail about my problem.
"servlet" in my post here actually means a custom servlet I wrote for rendering an image that is stored in db as ordimage. In this servlet, I get hold of my appmodule by using Configuation.createRootApplicationModule(). By doing so (If I'm not wrong) a new database session/connection is created. What I'm going to achieve is set application context for this new session/connection in db with the data stored in a session backing bean in the view layer.
I can pass the required data to the servlet thru url parameter, but I don't want to do it this way for the reason that the data may contains sensitive information.
I hope I have explained myself well.
Message was edited by:
bsmt -
How to assign bean value to a local variable in JSP using struts.
Hi everybody!
I've a problem that puzzled me on how to assign a bean value to a local variable like String in JSP using struts.
we can have someting like this to display the value
<bean:write name="detailService" property="status" />or
<bean:define id="theStatus" name="detailService" property="status"/>
This is country: <%=theStatus%>but an error occured when I tried like this:
String currentStatus = "<bean:define id="theStatus" name="detailService" property="status"/>";
or
String currentStatus = "<bean:write name="detailService" property="status" />";Is there a way to do this?.....
Any help pretty much appreciatedJava != JSP.
The <bean:define> and <bean:write> tags are custom tags meant to appear in the HTML section of a JSP file, as opposed to the scriptlet section. They actually get turned into java code as part of the translation process.
The <bean:write> tag naturally just writes out what you tell it to.
The <bean:define> tag defines a local variable, and gives it a value.
this should do it.
<bean:define id="theStatus" name="detailService" property="status" type="java.lang.String"/>
<%
String currentStatus = theStatus;
%>With the advent of JSTL, you shouldn't really need to use scriptlet code anymore. Personally I am for 0% scriptlet code in any jsp I write. -
How to find out the type of the value stored in a string variable?
Hi,
How do i find out the type of the value stored in a string variable?
for example,
I have a string variable str, in which the following type of values wil be stored
1) Intger
2) Long
3) boolean
4) Char
Is there any method to find out the type of the value, anything like str.getType()?. Please kindly help me. Thanks in advance.Hi All, i'm sorry for the double posting, by mistake it occured.
Thanks for your replies, i have a string variable str, in which the value is stored and i have another string variable type, in which the type of the value is stored.
For example,
String str = "15";
String type = "Integer";
Is there any way to verify whether the value stroed in str is of type stored in the variable 'type'. I want to write a method of type boolean, it will throw true of the value stored in str is of type 'type'. Thanks -
I need to add the values stored in the session object into the html textbox
Dear Sir,
i have been trying to create an edit employee details page
What i have done till now is as follow:
1. Got employee id from HTML page.
2. Compared it with the id stored in the database.
3. If the id is correct then pulled the record of the corresponding employee and stored it in the session object.
4. Dispatched the session values to another servlet EditEmpDetails2.java
what i need to do now
5. Now i need to set the session values in the text field of the html form
6. I also need to be able to edit those vales and store the edited values in the database.
Please help me as i have tried doing it for 1 week without any clues
i have tried to create a html page which is something like this:
<html>
<head>
<title>Edit Employee Details Page</title>
<body BGCOLOR="red" text="black">
<h1 ><font color="black">Edit Employee Details Page</font></h1>
<form action = "EditEmpDetails" method="Get">
<table width="50% align="center"
<tr><td>Employee ID: </td>
<td><INPUT TYPE="TEXT" name="employeeid"<br></td></tr>
<tr><td><center><input type="submit" value="submit"></center></td></tr>
<tr><td><center><input type="reset" value="reset" ></center></td></tr>
</table>
</form>
</body>
</html>
design of my servlet EditEmpDetails.java
public void EditEmpDetails1 extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
PrintWriter out = response.getWriter();
response.setContentType("text/html");
HttpSession session = request.getSession();
String employeeid;
String X = request.getParameter("employeeid");
System.out.println("Employee iD:" + X);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:murphy");
String query = "Select * from users where employeeid=?";
PreparedStatement stat = con.prepareStatement(query);
System.out.println(stat);
stat.setString(1,X);
ResultSet rs = stat.executeQuery();
while(rs.next())
String Z = rs.getString(password);
if(Z.equals(X))
String A = rs.getString(1);
session.setAttribute("employeeid", A);
String B = rs.getString(2);
session.setAttribute("firstname", B);
String C = rs.getString(3);
session.setAttribute("lastname", C);
String D = rs.getString(4);
session.setAttribute("gender", D);
String E = rs.getString(5);
session.setAttribute("dateofbirth", E);
String F = rs.getString(6);
session.setAttribute("address", F);
String G = rs.getString(7);
session.setAttribute("postalcode", G);
String H = rs.getString(8);
session.setAttribute("phone", H);
String I = rs.getString(9);
session.setAttribute("mobile", I);
String J = rs.getString(10);
String url = "/EditEmpDetao;s.java";
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url)
dispatcher.forward(request,response);
catch (Exception e)
system.out.println(e)
I do not know how to put the values stored in the session object into the html text box3. If the id is correct then pulled the record of the corresponding employee and stored it in the session object.do you really need to store this in session object?
5. Now i need to set the session values in the text field of the html form which form? in a new html/jsp page? i suggest go for a JSP
In your JSP page use JSP expression tags to put the session attributes.
it's something like : <input type='text' name='employeeid' value='<%= session.getAttribute("employeeid") %>' >and you need to generateanother servlet for saving the details/modifications to the database.
I think i m clear enough.
if you need more clarifications. just try it and then post your problem.
Diablo -
SAP-R/3- In which table, numeric values stored in equipment characteristis
SAP-R/3- In which table, numeric values stored in equipment characteristis are captured.
In AUSP table Char values in equipment characteristics are captured against object number.But this table does not cappture numeric characteristics.
Are these numeric values captured in any function module?Hi
check the BAPI for characteristics
BAPI_OBJCL_GETDETAIL
BAPI_OBJCL_CHANGE
or use the fun module:
CLAF_CLASSIFICATION_OF_OBJECTS.
You can use the tables
CAWN,INOB and AUSP to get the characteristics
Regards
Anji -
How can i get the value stored in the session object using its sessionid
how can i get the value stored in the session object using its sessionid by running stand alone java application
myforum wrote:
how can i get the value stored in the session object using its sessionid by running stand alone java applicationThis does not seem to make sense! You need at least to give a lot more detail of what you are doing. -
Analysing waveform for digital values stored in a file
i have certain digitals values obtained in a file in .txt format.
i have to obtain a waveform by giving the input as these digital values in that file.
I have programmed for array input manually.
But the waveform analysis should be made such that it do analyze automatically by taking the values stored in the file.
The values are stored as like follows-
0.00159
0.01432
0.01654
0.15432
etc
Give me a module to do this task.Use the Read from Spreadsheet file and then just connect it to a waveform chart. This will do what you need. Post back.
-
How to compare the values stored in the list
Hi,
I am having the requirement that i want to compare the values stored in the list.How to store the values in the list and compare the list values stored inside it.
Regards,
Ahamadhttp://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#sort(java.util.List)
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#sort(java.util.List,%20java.util.Comparator)
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Comparator.html
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Comparable.html -
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 jstlYou 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. -
How do I update a bean value from an AJAX call?
Hi all,
How do I update a bean value from an AJAX call? I suppose I could write a servlet to do it. However, this seems like a common problem, so I was wondering if there was some built in solution.
Thanks,
Grae
Edited by: caalip2 on Mar 30, 2010 1:07 PMcaalip2 wrote:
Raymond
Basically, I would user the following. The first choice for IE, the second for Firefox.
new ActiveXObject("Microsoft.XMLHTTP");
new XMLHttpRequest();
GraeDon't do this to yourself. If it were that easy there wouldn't be AJAX frameworks for JSF. Find one you like and use it. I've used a4j (part of RichFaces) successfully. -
Access values stored in 2D Array in HashMap
Hi everyone i would like to know how to access values stored in a 2D array inside a HashMap
Here is a drawing representation of the map.
So to get the KEYS I just have to execute this code:
this.allPeople = personInterests.keySet();But how can I get acces to the actual values inside the 2D Array?
My goal is to create a treeSet and store all the elements of the first array in it, then look at the second array if any new elements are detected add them to the treeset, then third array and so on.
I tried this code:
Object[] bands = personInterests.values().toArray();
for( int i=0; i<bands.length; i++)
this.allBands.add(bands.toString());
}But this.allBands.add(bands[i].toString())seems to be the problem, Dealing with a 2D array, this code only return a string representation of the Arrays and not a string representation of their elements.
Using my logic I tried to execute:
this.allBands.add(bands[0][i].toString());But i get a ARRAY REQUIRED BUT JAVA.LANG.OBJECT FOUND
I really don't know the way to go.
Thanks to anyone that will help.
Regards, Damien.
Edited by: Fir3blast on Mar 3, 2010 5:27 PMYou'll just need to cast the object to the correct type. This is nothing to do with HashMap at all. If you don't know what that means then your google keywords are "java cast tutorial".
-
Purchase Order ME23n - communication tab - where these values stored
Dear all
Can someone tell me where the
Purchase Order ME23n - communication tab - where these values stored
I am not able to find it.
Regards,
VenkatTable EKKO. All fields in communication tab are available here
EKKO-IHREZ Your Reference
EKKO-VERKF Responsible Salesperson at Vendor's Office
EKKO-TELF1 Vendor's Telephone Number
EKKO-UNSEZ Our Reference -
User Settings - To Clear a default value stored by the Users
Hi All,
Are the user settings like default values will stored in any table? if so can anybody provide me that table name? I do want to clear the default COQ category value stored by all the users. If not in table, how can i clear this value?
Thanks
MugundhanHi,
The settings saved for a user can be seen in SU01 - Personalization tab. You can delete the required default settings for user from Personalization tab.
Regards
Sejo
Maybe you are looking for
-
Macbook Pro does not start up and nothing works. Need recovery!
Hi there My MacBook Pro has shut down while wathcing a video and when ever I try to start up, a sign looking loke"no parking (Prohibitory Sign)" comes up after grey screen. I tried to start it in safe mode but it does not go in safe mode. Tried pram
-
I cant seem to play online movies, it tells me to get media player or adobe flash player
I have a problem when I try to watch movies especially Anime online, it tells me to download adobe flash palyer and when I try to download free apps it tells me to give my credit card details.
-
I am an independent film maker, just getting underway...I've purchased two 19 monitors to edit on, but just want to use my G4 17 as the computer...how do I hook those two monitors in and can I still control the two screens when the laptop is closed?
-
Using RFC adapter as TRFC call
Hi Folks, My requirement is to use the RFC adapter as a TRFC call. Can anyone guide me how to do that ? Regards, Santosh
-
Reg : Button Option in Work item
Hi All, I want to display a button in workitem. When user click on it. it keep the workitem in the inbox and take him to message creation where he can write his query and send it. Let me explain it. The requirement is that when any workitem is creat