473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

jsp:getproperty setting to var

4
Greetings all,

I am new to Java, JSP and javascripting. I was passing parameters in a query string and have learned the dangers therein, so am now trying to pass a parameter as a javabean property instead.

I see many tutorials where jsp:setProperty and jsp:getProperty are used, and they make sense. I can get them to work if I do the basic "Hello world + input" type of page.

But what I need to do is get the property and assign that value to another variable, which I can pass to another webpage as a request parameter (this time with location hidden).

The part I can't get to work is:

var cname = "<%=jsp:getProperty name=/"myJspUIHelper/" property=/"custname/"%>"
;

Is that possible somehow?

(more code below)

Thanks very much,
Judy
------------------------------------------------------------------------------------


<html><head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<jsp:useBean id="myJspUIHelper" class="com.medcmp.fastweb.view.JspUIHelper" sco
pe="session"/>
<title>Channels</title>
<SCRIPT LANGUAGE=JAVASCRIPT1.2 TYPE="TEXT/JAVASCRIPT">
var preload = "";
var ppathUrl = "";
var cname = "<%=jsp:getProperty name=/"myJspUIHelper/" property=/"custname/"%>"
;

if (top.parent.location.search.length > 0) {
preload= top.location.search.slice(0);
}

ppathUrl = "/fwb_live/fastweb/jsp/pPathSeamless10_3_4.jsp" + preload + cname;
Nov 5 '06 #1
1 4373
Judy K
4
Progress!

figured out how to assign bean property to a variable. Instead of doing jsp:getProperty, I can call <beanname>.<getmethod> (see below). Unfortunately, the value is always coming up null now! Trudging along...

JK
----------------------------------------------------------------------
var cnam = "";
if (top.parent.location.search.length > 0) {
preload= top.location.search.slice(0);
}
cnam = "<%= myJspUIHelper.getCustname() %>";
ppathUrl = "/fwb_live/fastweb/jsp/pPathSeamless10_3_4.jsp" + preload + "&custnam
e=" + cnam;
Nov 6 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jagdeesh | last post by:
Hai Colleagues, I am using Tomcat 4.1.24 and JDK 1.4.0_03 in my winXP machine. I've transferred a set of folders(containing jsp files) into tomcat's webapps directory(to /webapps/bob ,...
1
by: Jeff | last post by:
I am currently trying to capture the output generated by a servlet in a JSP. What I would like to do is place all of the output into a textarea. It is my understanding that we can't just...
4
by: Peter Beck | last post by:
Hi - I have a question for someone who has experience with both ASP .Net and JSP/Servlets, relating specifically to thread safetly. In JSP, we say that instance vaiables of a servlet are not...
3
by: Judy K | last post by:
Greetings, Trying to assign a javabean property and get it in another page with <jsp:getProperty .... I can get it in the same page, but in different page it is always null. scope =...
4
by: mjahabarsadiq | last post by:
HELLO FRIENDS I HAVE ONE JAVA CODE WHICH PARSES AN XML FILE AND PRODUCE A QUERY TO CREATE TABEL IN A DATABASE. BUT I NEED THE CODE TO BE USED IN A JSP PAGE. HOW TO USE THIS PAGE WITH JSP. ...
2
by: judge82 | last post by:
I have two JSPs, one takes a request and the other displays the result and I am having problem with the javabean to connect the two here are my codes takes request <%@page...
0
by: krishna81m | last post by:
Could some one please explain why the session is not being maintained when I am doing a forward in a servlet after setting a cookie. I am even unable to set session attributes or parameters and...
0
by: Vittorix | last post by:
hi all, in a JSP page: <% String bookBeanBeg; bookBeanBeg = "bookBeanBeg1"; %> <jsp:useBean id="<%=bookBeanBeg%>"
0
by: TeenaRoz | last post by:
Hi, Can some one help me in finding out why this exception occurs when ever I try to load a particular JSP page? Oct 29, 2008 4:23:54 AM org.apache.catalina.loader.WebappClassLoader loadClass...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.