namrata suri

Ranch Hand
+ Follow
since Oct 22, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by namrata suri

Ya I do not want the get method to be visible in the jsp and jobList is an arraylist in the servlet which consists of several beans.

I tried using beans like this in my jsp



But, it says "cannot find property Key"....

Am I not writing the bean part correctly because, I checked on various sites and this is how they mentioned it.
Hi,

I am relatively new to the beans world. I have an action class where I am retrieving values from a database and putting the values in a bean which has 'n' no. of properties (since there are n columns per row of the db). Now I am putting these beans in an ArrayList and this list I am passing to a jsp where the values can be printed. Here are code snippets
I am not using DAO yet so please, do not refer to it.

jsp:



Here, the functions of the bean are visible and I do not want that. How can I use beans to solve the problem.

Hi,

I have written a code in which based on a user's selection, he either inserts data into a db or data is simply displayed from the db.
I had originally written everything in jsps using sql taglibs but was advised to use struts so that the presentation layer was different from the functional. I could implement that for the insert functionality but for the display part, I am having trouble understanding how to achieve it using struts.

So, when the user selects 'display' option, I included a form that autosubmits. So, i made a mapping in struts-config.xml for an action class. Now in the action class, I execute the sql queries and get a result set. How do I pass this to a jsp so that the values are printed.

14 years ago
Hi,
I have a form from which the values are being passed to another jsp. In this jsp, i have a drop down box with some options. based on the value submitted by the form, one of those options has to be selected automatically or made the default value.

I am not using html struts taglib.

so my code is like this



That is the rough structure. Since, s was passed, I need to make s the default selection in the drop down box.
14 years ago
JSP
Hi,

I have written a form in an jsp which accepts three values .Apart from this I also have drop down menu from which a value is selected.

These four values are now accessed in the second jsp where I am putting these values into a database.

Here is the code:



I tried putting the <%= ... %> part in double quotes as well but am getting an error as follows:

Column 'India' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement........

The value of the session variable is getting reflected correctly but is not getting inserted into the table.

14 years ago
JSP
Hey,
Thanks for the answers. I found my way around the problem. Did not realize the tutorial was that bad.

I guess the thread can be closed now.
14 years ago
JSP
Thank you for clearing my doubts to some extent. I am new to jsp's and was following this tutorial.

http://www.eclipse.org/articles/article.php?file=Article-EclipseDbWebapps/index.html

Here, he has written a similar code and the parameters seem to be getting passed. I think its better if I write the sql code in another jsp.



14 years ago
JSP
I am not able to figure that out because the moment I run the jsp, i get the error messages.

As in, the form should come first asking me to enter the values... but instead I directly get the error without getting a chance to fill the form.
14 years ago
JSP
Hi David,

No the code I posted is the actual code and in fact is from an eclipse tutorial. Even before the form comes up, I get an error. If i replace the ? with actual values, the code runs just fine, so i am guessing something is wrong with the sql:update - sql:param part. Unable to figure that out though.

Thank You.
14 years ago
JSP
Hi,

I have used the following code snippet but am getting errors.

Here is the code:



The error I am getting is :

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException:
INSERT INTO positions(id,job_title) VALUES (?,?)


: Type is not supported.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)



14 years ago
JSP
I included the struts-el.jar file and now I am not getting the build path error.

But, when I am compiling, I still get an error as follows for the following line of code



,saying expression cannot be evaluated. The reason I shifted to html-el was so that I could pass the value on to the jsp whenever the image was clicked. I do not know how to proceed further because, <bean:write> is not working under value attribute because of the quotes compatibility issues.
14 years ago
@Ankit

Yes, I included struts.jar, struts-html-el.tld as well
I have a doubt though.

My struts,jar and struts-html-el.tld are from 1.8 but other jar files
are from other versions of struts. Is that a problem.?
14 years ago
Hi,
I have a jsp where I am using the following taglibs



I am using them as below:



The reason I included html-el tag was because with html, I had to use a bean:write for the value and that was not getting passed correctly. Hence, I shifted to <html-el>. But, i am getting the error

The tag handler class for html-el:image (org.apache.strutsel.taglib.html.ELImageTag) was not found on the build path
and
Unable to load tag handler class.

Help!!
14 years ago
Thank you.I downlaoded the struts-html-el.tld library and included it in my web-inf folder and used it in my code

<html-el:image .....................property='key' value="${mapVals.key}"

I am getting the following error "The tag handler class for html-el:image (org.apache.strutsel.taglib.html.ELImageTag) was not found on the build path"

I have been using libraries from different versions of struts but predominantly struts2. Is that a problem since this struts-html-el library i am using from struts 1.1
14 years ago
Hi,

I am using the html:image tag and am passing values to a jsp using the property and value attributes. Here is the code:

<html:image onclick="javascript:popUp('success1.jsp')" src="images/images.jpg" property="key" value="<bean:write name="mapVals" property="key"/>" />

Am catching this value in success1.jsp as
request.getParameter("key");

But only null is getting passed.

Help.
14 years ago