Saif Taher

Greenhorn
+ Follow
since Mar 21, 2012
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 Saif Taher


Thank you guys, your posts were much helpfull
12 years ago

Hi,

I was really wondering if we can do the following:

I have a Struts FormBean with the following getters and setters:

public String getLogData() {
return logData;
}

public void setLogData(String logData) {
this.logData = logData;
}

I want to set this logData member from JSP page using Java and JavaScript like this:
<%
FormBean form = (FormBean) session.getAttribute("FormBean");
form.setLogData(%> call below JavaScript here!! <%);
%>

<script>
function getTestData(){
return "log data";
}
</script>

I get this data using Javascript, hence is this possible or any way to set Java Bean members through Javascript?

Thanks
12 years ago