How to send go back to client
Hi, I have a JSP page A with a submit button on it. When the submit button is pressed I wan't the following to take place: 1) Call a JPS page B that parses form data and other stuff. 2) Make the client reload page A (to reflect changes made to session scoped variables by page B) When the client reloads it must pass query strings (i.e. A?parm=value) to the server. I currently do this as follows: Place a hidden value containing the URL of page A including parameters: input type=hidden name='origin' value='%=HttpUtils.getRequestURL(request) + "?" + request.getQueryString()%' Send a redirect to this URL from page B: response.sendRedirect(request.getParameter(origin)); Can this be done without using the hidden value containing the URL like sending a GO BACK AND RELOAD to the client. /Morten === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Commercial JSP Engine for 1.0.
Do you know of any JSP engine compatible with 1.0 Specs that is available for commercial use. It looks like Sun's reference implementation cannot be used commercially. The license says, Sun Microsystems, Inc. grants to Licensee, a non-exclusive, non-transferable, royalty-free and limited license to use Licensed Software internally for the purposes of evaluation only. No license is granted to Licensee for any other purpose. Licensee may not sell, rent, loan or otherwise encumber or transfer Licensed Software in whole or in part, to any third party. Does anyone have a 1.0 JSP engine. I appreciate your response. thanks in advance, Harmeet === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: Commercial JSP Engine for 1.0.
You can get a licensed copy from JRun which supports JSDK 2.1.1 JSP 1.0. check out http://www.livesoftware.com/products/jrun/ for more details. Thx Kumar Harmeet Bedi wrote: Do you know of any JSP engine compatible with 1.0 Specs that is available for commercial use. Does anyone have a 1.0 JSP engine. I appreciate your response. thanks in advance, Harmeet === -- Kumaraswamy A. Sun-Netscape Alliance [EMAIL PROTECTED] phone:650-937-2429/pager:888-779-7696 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Websphere Application Server's support for JSP 1.0
Hi, I am using Websphere application server 2.0 with IBM HTTP Server. Now the Websphere supports only JSP 0.91. What should I do to be able to use JSP 1.0 ? What are the different possible ways? Pros and Cons of each ? Thanks in advance, Mahesh. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
recompilation of modified includes
hi, I'm perplxed by this section of the JSP 1.0 spec: 2.8.3 second paragraph: "A JSP engine can include a mechanism for being notified if an included file changes, so the engine can recompile the JSP page. However, JSP 1.0 does not have a way of directing the JSP engine that included files have changed." .. Does this mean that if I have this: main.jsp html body %@ include file="inc.jsp" % /body /html inc.jsp --- bI'm inc.jsp/b .. I modify inc.jsp, and then reload main.jsp in my browser. According to the above, main.jsp is NOT required to be recompiled. To force recompilation, I must manually touch all files that contain the include. Correct? If correct, why is this ever desirable? It seems to effectively render includes unusable since the author cannot guarantee coherency across files using the include. thanks! -- James === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: recompilation of modified includes
James Cooper wrote: I modify inc.jsp, and then reload main.jsp in my browser. According to the above, main.jsp is NOT required to be recompiled. To force recompilation, I must manually touch all files that contain the include. Correct? This depends on the implementation. Some will provide for checking included files for changes, and some won't. This is quite analogous to the situation with pure servlets. Almost every servlet engine supports dynamic reloading when the servlet class itself changes, but only some of them support automatic reloading when a non-servlet class referenced by the servlet is changed. The JSP 1.1 spec starts to talk about formalizing the notions of recompiling a page on these kinds of changes ... you might want to check it out to see if it meets your requirements. If correct, why is this ever desirable? It seems to effectively render includes unusable since the author cannot guarantee coherency across files using the include. It is perfectly acceptable in a production environment where the included files are *not* changing. Or when you don't want to pay the performance price of checking for the changes. Or when you are deploying in an environment where there is no compiler available at all (like an embedded server). thanks! -- James Craig === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
How to initialize radiobuttons/checkboxes from a bean
I am using a bean to initialize the form fields of a JSP. I understand how to use jsp:getProperty... to initialize text fields, or to just include a string within the page. However I'm a bit unclear on the best way to initialize radio buttons and check boxes. The only thing I've come up with is the following (somewhat ugly) solution: jsp:useBean id="mbean" class="..." scope="session"/ ... input type="radio" name="choice" value="apparel" % if (mbean.getChoice() != null mbean.getChoice().equals("apparel")) out.println("checked"); % Apparel input type="radio" name="choice" value="computers" % if (mbean.getChoice() != null mbean.getChoice().equals("computers")) out.println("checked"); % Computers ... Is there a more elegant way to accomplish this? Thanks. -- Bill -- Bill O'Keefe [EMAIL PROTECTED] Open Market, Inc.http://www.openmarket.com/ One Wayside Road TEL: 781.359.7296 Burlington, MA 01803 FAX: 781.359.8200 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: How to initialize radiobuttons/checkboxes from a bean
what about: adding an "equalsChoiceIgnoreCase(String s)" method to your bean (or a bean wrapper if you don't want to ?pollute? existing bean code) using the following jsp scriptlet: % out.println((mybean.equalsChoiceIgnoreCase("Apparel")) ? "checked" : ""); % i may be off a smidgen syntactically but i believe the idea has been conveyed. hope this helps, - james Bill O'Keefe wrote: I am using a bean to initialize the form fields of a JSP. I understand how to use jsp:getProperty... to initialize text fields, or to just include a string within the page. However I'm a bit unclear on the best way to initialize radio buttons and check boxes. The only thing I've come up with is the following (somewhat ugly) solution: jsp:useBean id="mbean" class="..." scope="session"/ ... input type="radio" name="choice" value="apparel" % if (mbean.getChoice() != null mbean.getChoice().equals("apparel")) out.println("checked"); % Apparel input type="radio" name="choice" value="computers" % if (mbean.getChoice() != null mbean.getChoice().equals("computers")) out.println("checked"); % Computers ... Is there a more elegant way to accomplish this? Thanks. -- Bill -- Bill O'Keefe [EMAIL PROTECTED] Open Market, Inc.http://www.openmarket.com/ One Wayside Road TEL: 781.359.7296 Burlington, MA 01803 FAX: 781.359.8200 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: Beans, beans, ....
At 12:59 AM 6/17/99 -0400, Bill O'Keefe wrote: At 12:36 AM 6/17/99 -0400, Brad Neuberg wrote: On Thu, 17 Jun 1999, Bill O'Keefe wrote: Chris, I have a question on using beans from JSP. According to my understanding, the usebean: tag can be used to access a normal bean, but one has to use the JNDI API to lookup a proxy to access an Enterprise JavaBean (ejb). Thus, one has to write a block of Java code in the JSP to get access to an ejb. Is this true, or does the usebean: tag also support ejbs, and if so, how? Thanks. -- Bill JSP 1.1 is supposed to have more EJB support. However, the details are sketchy. To make sure we're starting with a clear understanding: EJB's have nothing to do with regular JavaBeans (except that both happen to have the word 'bean' in their names, which was probably a bad marketing choice). If you want your JSP page to be an EJB client, then yes, you will have to follow the EJB client API from within your jsp page. Which means that you will have to use JNDI to locate your EJB. This has absolutely nothing to do with the way JavaBeans and JSP works. Thanks for the response. This was pretty much the same conclusion I came to, but I just wanted to make sure I wasn't missing something. It took me a few days of spec reading to determine that the only real similiarity between JavaBeans and Enterprise JavaBeans is that they are both components, with completely different characteristics (one for client side app development and the other for server-side development). Since JSP and EJB's are both part of the J2EE (Java 2 Enterprise Edition), they may provide more integration in JSP 1.1. But even if they make some things invisible, I would guess that under the covers, JNDI and the rest of the EJC client API would have to be followed. This is basically what I was asking, i.e., are there any EJB-specific options available with the usebean: tag to make things simpler for JSP developers who want to access EJBs. I realize it's not rocket science to locate an EJB via JNDI, but it seems to me that this causes the JSP to get 'cluttered' with some repeated boiler-plate code that could be hidden via a usebean (or maybe useEJB???) tag. Sounds like this is still TBD from what you're saying. Actually, couldn't you just have a servlet that looked up the EJB through the JNDI and then called the JSP file, passing the found EJB to the JSP file through an attribute in the Request object? I guess that would work, though I'd have to come up with an EJB attribute naming scheme that would not collide with existing attribute names in the request object. I guess it shouldn't be too hard to pick some obsure names for the EJB attributes to make the collision unlikely (I could even check first if I was real paranoid :-) Thanks for the suggestion. I still would like to see some support added to JSP to have a standard way to locate an EJB from a JSP (i.e., using some standard JSP tag). Brad, Well, I just re-read your response (and my somewhat lukewarm thanks :-), and what you suggested makes sense to me now! As a newbie to the servlet/bean/JSP world, I was confused by request 'attributes' and request 'parameters'. Now that I'm an 'expert' :-), your solution makes sense to me, and seems quite workable. Thanks for the tip. -- Bill -- Bill O'Keefe [EMAIL PROTECTED] Open Market, Inc.http://www.openmarket.com/ One Wayside Road TEL: 781.359.7296 Burlington, MA 01803 FAX: 781.359.8200 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: How to initialize radiobuttons/checkboxes from a bean
At 10:27 PM 7/20/99 -0700, James Todd wrote: what about: adding an "equalsChoiceIgnoreCase(String s)" method to your bean (or a bean wrapper if you don't want to ?pollute? existing bean code) using the following jsp scriptlet: % out.println((mybean.equalsChoiceIgnoreCase("Apparel")) ? "checked" : ""); % i may be off a smidgen syntactically but i believe the idea has been conveyed. hope this helps, Thanks. That is definitly an improvement. However, what I'm really looking for is a way to avoid scriplets altogether, i.e., just use some jsp:xxx tag to do the trick. I understand JSP 1.1 may help in this regard, though I really haven't looked into that yet. Anyway, your code is much better than mine :-) Thanks again. - james Bill O'Keefe wrote: I am using a bean to initialize the form fields of a JSP. I understand how to use jsp:getProperty... to initialize text fields, or to just include a string within the page. However I'm a bit unclear on the best way to initialize radio buttons and check boxes. The only thing I've come up with is the following (somewhat ugly) solution: jsp:useBean id="mbean" class="..." scope="session"/ ... input type="radio" name="choice" value="apparel" % if (mbean.getChoice() != null mbean.getChoice().equals("apparel")) out.println("checked"); % Apparel input type="radio" name="choice" value="computers" % if (mbean.getChoice() != null mbean.getChoice().equals("computers")) out.println("checked"); % Computers ... Is there a more elegant way to accomplish this? Thanks. -- Bill -- Bill O'Keefe [EMAIL PROTECTED] Open Market, Inc.http://www.openmarket.com/ One Wayside Road TEL: 781.359.7296 Burlington, MA 01803 FAX: 781.359.8200 === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".