jGuru
Register Email     Password Forgot your
password?
HOME FAQS FORUMS DOWNLOADS ARTICLES PEERSCOPE LEARN

  Search   jGuru Search Help

View:
FAQ Entries in JSP

How can you copy a JavaScript variable to a JSP session variable without using cookies?
I am trying to store the value of a SELECT object in a session variable so it can be accessed in other JSP's for use in database lookups.
Can JavaScript be used to access JavaBean properties within a JSP page?
I want to pass an array of values that I have built within a JavaBean to a JSP, and for JavaScript within the page to process it and display it. The Bean sets the array, and the JavaScript has an identical array defined. I have tried
javascriptArray = "<%= myJavaBean.getArray() %>";
but this doesn't work. Any ideas, anyone?
Why use JSP? All that we can do with scriptlets we can do with JavaScript as well, I think. Can somebody explain?

I have a framed JSP application and would like to make it so pages meant to be viewed as a frame can only be viewed as a frame.

So, if they type the direct URL to that frame, I would like that page to check to see what frame it is in, and if it is in, say, _top, then redirect to the main (framed) page.

Is this possible?

Is it possible to press a button in one frame and caused a form in another frame to be submitted?

I have a scrollable jsp in one frame and another frame with just buttons. I want to be able to press a button and sumbit a form from the jsp page. Thanks for any replies.

I have a JSP that uses frames inside frames. How can say to the browser to open the Error Page in the main frame (the topmost frame)?

I have a html file where i have 2 frames. (1) in first frame(let us call it navigation frame) i have a html file for navigation and (2) in another frame(let us call it jsp frame) i have a jsp page which asks for login.and based on who logs in , i want a different navigation frame and also a different jsp page in jsp frame. i can get a different jsp page in jsp frame by having the following code in a jsp file that comes after login. But how do i also make a differnt navigation frame in place of original navigation frame? Basically i need a functinality like Target=_top as in html links which take to a differnt file replacing all frames in the page. -------------------------------------------- findpos is a string which gets who logged in from a javabean.
<%if(findpos.equals("member"))
{%>
<%@  include file="link.html" %>
<%}
else if (findpos.equals("staff"))
{%>
<jsp:forward page="staffindex.html" />
<%}%>

<% } else { %>
   We are sorry, but you are a illegal user!
<% } %>

I would like to make sure that my users only enter any combination or letters or numbers for a particular field in my JSP (case insensitive). What is the best way to do this? I see that there is method "isLetterOrDigit" for the Character class, and I suppose I could use a for loop and apply this method to each character of the string, but I'm wondering if there is a better way .... Thanks, jv

I have a jsp page(a view). It is actually a popup to a main-page. This popup is to email people. The popup has a 'Send' button. On clicking 'Send' button, I want the popup to close immediately(which I can accomplish via javascript...onclick submit form and close popup) and leave the processing to the server. I am using Struts, so the ActionServlet will direct it to an Action perform() wherein I have Stateless session beans going to handle the emailing of input data.

I have not done this, but contemplating such a design. Now my doubts are:-
a)will the popup close(or will it wait for all the backend processing to finish....
b)will the popup close..but the backend processing bomb.

I was wondering would it be possible for JSP pages to update the value of the a combobox without reloading the page. Like for example with javascript I know you can do it there where ONCHANGE you call a function to change the values of the combobox and taht would work. But I was wondering can you do something like that with JSP maybe using some kind of custom tag or something.
I need more screen "real-estate" for my JSP application. How do I remove the toolbars in IE and netscape to increase screen "real-estate"? Need it for evey screen of the application.
I am trying to display a set of records and each
record contains 2 or 3 fields along with a submit button
and whenever the user clicks the button i would like
to track the contents of the respective record and pass it as the paramter to the next jsp.

By using innerHTML in jsp page which need to populate the data from database in to that page without refreshing that. Here is the actual problem i'm having. i have a jsp page which contains 6 dropdown boxes, if user selects first one, onChange event will fire and it will get data from database and the jsp page is refresing and the data in the remaining 5 dropdown boxes are populated based on the data from database. i would like to do this without refreshing the jsp page, i have an immediate answer that is 'innerHTML' and 'IFRAME' concepts. but i don't know how to implement this, can anybody show me some direction in this. this is an urgent one. thanks,

I have a page that has an Add button. On clicking that, a child window opens. When the child window form is submitted by the user the (child)window should close and the parent form should be reloaded. (And this should not happen before the child form does its processing..or else the updates wont be seen:)

I tried a javascript after the child window </form> tag to reload parent and close child...but did not seem to work

How would you set this up?

I am using struts(Jakarta's) framework, when I click on a link from one jsp, the form is getting submitted multiple times. I am using only one form, and only one javascript method to submit that form. Is there any way to fix that problem?
I have a JSP which is divided into 2 side-by-side frames.

The left frame contains an applet which displays a JTree and the right frame contains buttons like "Add Node", "Remove Node".

When "Add Node" button is clicked, a Tree Node has to be inserted into the JTree component in the applet on the left frame. How do I access this component in the left frame.

Basically, what I am asking is how do I access a component in the left frame from an action in the right frame? Is there a way to add the JTree object or the applet to the session as an attrbute? If yes, then how do I do it? If I can somehow add the applet to the session, then I can access it from the Session and invoke the appropriate "add" method!

Here is the code for the left frame that holds the Tree applet:

<html> <head> <title>Study Tree </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> Study Tree

The tree displays all the Surveys, Questions and Responses in this Study

<div align="center"> <jsp:plugin type="applet" code="StudyTree.class" jreversion="1.3" align="center" height="60%" width="90%" nspluginurl="http://java.sun.com/products/plugin/1.3.0_01 /plugin-install.html" iepluginurl="http://java.sun.com/products/plugin/1.3.0_01 /jinstall-130_01-win32.cab#Version=1,3,0,1" > <jsp:fallback>

Unable to start Java Plug-in.

</jsp:fallback> </jsp:plugin> </div> </body> </html>

Please help, its urgent!

I am writing a simple jsp to retrieve and save from/to my MySQL db. My retrieve and save functions work great. Now, depending on the action in the browser, I would only like to invoke one of the methods. For example, for the onChange event, I would like to get the info from the db. For the onClick event, I would like to save the info to the db. Considering these actions are on the client side and jsp is on the server side, is there a way to do this? If not, does anyone have a suggestion on how this can be done?

Thanks,

- Mike



Ask A Question



Related Links

JSP FAQ

JSP Forum

Sun's JSP home page

SUN's JSP-Interest mailing archive

IBM's "Introduction to JSP" online course

JSP Insider

Wish List
Features
About jGuru
Contact Us

 



The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers