Khyathi nyala

Greenhorn
+ Follow
since Sep 30, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Khyathi nyala

Hi Ankit,

Thanks for the very quick reply. I do not have any form tag inside my jsp page. So should i use just <form: or <s:form. Can you please give me example for the <s:form to how exactrly use it. ?

For the javascript, i was doing in this way becaue i have the update method inside my action class and i am declaring some this like this to call the method inside the struts.xml



So when i say .submit, it directly calls this update method.

Thanks.
13 years ago
Hi,

I am having <s:select which contains 5 values inside the <s:iterator tag. Also, I have <s:button tag inside this iterator and button onClick event, calling the javascript function and inside this funciton setting up action and submitting. The code snippet as follows


So my page looks like the following:

<table>
queue name1 dropdown list savebutton
</table>

<table>
queuename2 dropdown list savebutton
</table>



I am accessing this setStatus of <s:select name attribute inside my action class. For example, when I click on first save button, the javascript funciton has been called and coming to the action class. Inside the action class when i try to print the "setStatus", i should get only queue name1 drop down value, But instead iam getting all the quename1, queuename2 drop down value with comma seperated. Can any one please help me how to get only the selected dropdown value of that pariticular submit.

Thanks.
13 years ago
Hi Bear,

Now the code working. After your post, I checked my code again for the # (As I was using s:iterator in the begining, i was reading the values using #dataobj...) and removed it.
And one more mistake, I was doing is, not reading as an expression the items attribute.

<c:forEach var="data" items="${dataobj.dataList}">

Now "data" is of type list and reads all the properties from the bean and I am able to get the values using pageContext.getAttribute("pageName") as I am setting up the values at the page level.

Thanks so much...........for the help.
13 years ago
JSP
I did try doing <c:out var="pageName" value="${#data.pageName}".
Its just printing #data.pageName.

If I do like this <c:out var="pageName" value="${data.pageName}", the compiler complains that pageName property not found.
13 years ago
JSP
Hi,

I am not able to get the value using pageContext.getAttribute("pageName") when setting using <c:set. The following are the steps iam doing.


<% pageContext.setAttribute("pagename",pageNameStringValue); %>

<%@ page isELIgnored="false" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<s:bean name="com.abc.example.console.data.CommonDataService" var="dataobj">
<c:forEach var="data" items="dataobj.dataList"> Here getting the datalist from the CommonDataService which of type data bean
<c:choose>
<c:when test="${#data.pageName==pageScope.pageNameStringValue}"> Here checking against the script value above
<c:set var="cpageName" scope="page" value="${#data.pageName}" /> Here trying to set the cpageName variable to the value of the pageName from dataList

<%
System.out.println ("Displaying Page name: "+pageContext.getAttribute("cpageName"));
%>

The PROBLEM is <c:set value is not setting up the cpageName at page context level and when i do System.out, I am getting NULL value.
I am using struts2, jstl1.2.
Can anyone please let me know as soon as possible, why is it not setting up at the page scope.

Thanks so much.....

13 years ago
JSP