Re: Invoking scoped beans from other beans and servlets
Write the bean properties to the ServletContext for that app, and call getServletContext(beanApp) from your current app to get the properties. -- padhu - Original Message - From: Luis Javier Beltrán [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 02, 2002 2:37 PM Subject: Invoking scoped beans from other beans and servlets Hi everyone, Is there a way to get some properties from a session-scoped bean from another bean or servlet?? I need to get some session-related information in several parts of an application and I have a session bean that holds such info. Thanks in advance Luis Javier === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: Urgent, Making taglib available to JSPs without those being in a WAR
put %@ taglib uri=... prefix=... % in your jsp pages. Read about this directive in the jsp spec. Also register the taglib in the web.xml using the taglib element. -- padhu - Original Message - From: m batsis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 29, 2002 6:49 AM Subject: Urgent, Making taglib available to JSPs without those being in a WAR Hello, Apologies for the dumb question but I have zero time; hope one of you can save me here. I'm under a situation where I have some JSPs *not* in a WAR file. How can make a taglib available to those JSPs without deploying them using a WAR file? I'm using iplanet application server 6. Thanks in advance for your time and help. Manos === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: Urgent, Making taglib available to JSPs without those being in a WAR
He still has to have a web application. Create a web-inf directory and create a web.xml file. Maybe I am missing something. -- padhu - Original Message - From: Karr, David [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 29, 2002 12:06 PM Subject: Re: Urgent, Making taglib available to JSPs without those being in a WAR You're answering a different question than he asked. He doesn't have a web.xml file, as he doesn't have a WAR. I don't see how you can do this. -Original Message- From: padhu vinirs [mailto:[EMAIL PROTECTED]] put %@ taglib uri=... prefix=... % in your jsp pages. Read about this directive in the jsp spec. Also register the taglib in the web.xml using the taglib element. -- padhu - Original Message - From: m batsis [EMAIL PROTECTED] Hello, Apologies for the dumb question but I have zero time; hope one of you can save me here. I'm under a situation where I have some JSPs *not* in a WAR file. How can make a taglib available to those JSPs without deploying them using a WAR file? I'm using iplanet application server 6. = To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: code 0 error
It iscomplaining about the Javascript line which has a ; in the end: window.location.href=http://192.168.39.143:8080/NEWEPG/EPG.html;; -- padhu Edward King wrote: I have a JSP, I create a Submit button,when click this button,it will transport a variable to a Servlet. But when I click this button,IE6 raise a error,like follows: line:2 char:13 error: missing ';' code:0 URL: http://192.168.39.143:8080/NEWEPG/servlet/program_send?choice=0 Why raise error? I am puzzled with it.Please help! My JSP code is follows: %@page contentType=text/html;charset=GB2312% %@page language=java% %@page import=java.io.* % html head meta http-equiv=Expires value=May 31,2001 12:00:00 titleGuide/title function returntomenu() { window.location.href=http://192.168.39.143:8080/NEWEPG/EPG.html;; } /script /head body background=http://192.168.39.143:8080/NEWEPG/images/EPG.jpg; text=FF form name=input action=http://192.168.39.143:8080/NEWEPG/servlet/program_send?choice=0; method=POST Bfont size=5 color=redSend system/B IMG src=images/bird.gif height=50 width=100 alt=Electronic Programme Guide font size=2 color=blue td valign=right/td % String value[]=new String[2]; String str; try { BufferedReader in=new BufferedReader(new FileReader(F:\\Apache Tomcat 4.0\\webapps\\NEWEPG\\version.data)); str=in.readLine(); in.close(); value=str.split(:); System.out.println(str); } catch(IOException e) { System.out.println(read file error); } % BR BR BR BR BR centerBfont size=5 color=#00FA9APlease version(0-31)/font/B/center hr BR BR table align=center width=100% cellspacing=1 cellpadding=1 border=1 center td align=rightNIT version:/td tdinput type=Text name=nitversion align=left size=10 maxlength=2 value='%=value[0]%'/td td align=rightBAT-SDT-EIT version:/td tdinput type=Text name=otherversion align=left size=10 maxlength=2 value='%=value[1]%'/td /center /table BR BR hr BR BR center input type=Submit name=sendkbutton style=font-size:20;color:#FF;background:#7FFD4;cursor:hand value= Send input type=button name=returnbutton style=font-size:20;color:#FF;background:#7FFD4;cursor:hand value= Cancle onclick=returntomenu() /center /body /html === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
user-agent header value...
I am trying to find out the following information ( from a jsp page ): Browser Major Version Browser Minor Version I am not sure if there is a standard format for the user-agent header across all browsers and all OS. I have searched the web, but couldnt find any code or info regarding this. I have seen Javascript code that uses the navigator javascipt object which is not available in a jsp engine. I can parse this info for the browsers I have installed, but for older versions and for different OS, I dont have access currently. Can anybody help me out: Browser OS - IE 6.0 Mac, UNIX IE 5.0 and below Windows, Mac, UNIX Opera Windows, Mac, UNIX Netscape 6 and below Windows, Mac, UNIX Any help is appreciated. Thanks -- pady === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: What is the use of Page context ?
PageContext is a wrapper around all the implicit objects ( session, context, out etc ). It is used to store/remove/change attributes in all the scopes. And all tag handlers get to the implicit objects using only this object. From the spec: The PageContext provides a number of facilities to the page/component author and page implementor, including: a single API to manage the various scoped namespaces a number of convenience APIs to access various public objects a mechanism to obtain the JspWriter for output a mechanism to manage session usage by the page a mechanism to expose page directive attributes to the scripting environment mechanisms to forward or include the current request to other active components in the application a mechanism to handle errorpage exception processing -- padhu Gopinath D wrote: Hi all, Could u plz tell me what the page context in JSP is. I have seen some questions in many interviews. I was not able to find out this help me... Thanks in advance. Regards, Gopi. === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: trivial error...tomcat 4.1.12...
I dont see this email posted. So trying again... Padhu Vinirs wrote: I was not getting this error before. It has started suddenly today. An error occurred at line: 5 in the jsp file: /jsp/testBean.jsp Generated servlet error: [javac] Compiling 1 source file /home/pady/jakarta-tomcat-4.1.12/work/Standalone/localhost/jcwcd/jsp/testBean_jsp.java:7: '.' expected import TestBean; I have the class TestBean in WEB-INF/classes. It does not have a package. This was working fine till now. Any ideas ? -- padhu === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
trivial error...tomcat 4.1.12...
I was not getting this error before. It has started suddenly today. An error occurred at line: 5 in the jsp file: /jsp/testBean.jsp Generated servlet error: [javac] Compiling 1 source file /home/pady/jakarta-tomcat-4.1.12/work/Standalone/localhost/jcwcd/jsp/testBean_jsp.java:7: '.' expected import TestBean; I have the class TestBean in WEB-INF/classes. It does not have a package. This was working fine till now. Any ideas ? -- padhu === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: trivial error...tomcat 4.1.12...
Strangely, it works once I put in a package. Whatever Thanks -- padhu Karr, David wrote: In short, don't use the default package. Put all of your classes in packages. -Original Message- From: Padhu Vinirs [mailto:p.padhu;VERIZON.NET] Sent: Thursday, November 14, 2002 7:22 AM To: [EMAIL PROTECTED] Subject: trivial error...tomcat 4.1.12... I was not getting this error before. It has started suddenly today. An error occurred at line: 5 in the jsp file: /jsp/testBean.jsp Generated servlet error: [javac] Compiling 1 source file /home/pady/jakarta-tomcat-4.1.12/work/Standalone/localhost/jcw cd/jsp/testBean_jsp.java:7: '.' expected import TestBean; I have the class TestBean in WEB-INF/classes. It does not have a package. This was working fine till now. Any ideas ? -- padhu == = To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com = To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: trivial error...tomcat 4.1.12...
Thanks. You are right. I moved to 1.4 last week. And I learnt about this bug/enhancement last month. Just didnt put the two together. -- padhu Hans Bergsten wrote: Padhu Vinirs wrote: I was not getting this error before. It has started suddenly today. An error occurred at line: 5 in the jsp file: /jsp/testBean.jsp Generated servlet error: [javac] Compiling 1 source file /home/pady/jakarta-tomcat-4.1.12/work/Standalone/localhost/jcwcd/jsp/testBean_jsp.java:7: '.' expected import TestBean; I have the class TestBean in WEB-INF/classes. It does not have a package. This was working fine till now. Any ideas ? You have upgraded to JDK 1.4. See here for details: http://www.thejspbook.com/faq/details.jsp?id=1007 Hans -- Hans Bergsten[EMAIL PROTECTED] Gefion Software http://www.gefionsoftware.com/ Author of O'Reilly's JavaServer Pages, covering JSP 1.2 and JSTL 1.0 Details athttp://TheJSPBook.com/ === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: errorPage
Have the contents of the JspWriter been flushed already before calling the useBean action ? Then the error will not be transferred to the error.jsp. Also, make sure you set the isErrorPage=true. Also, set the keepGenerated variable to true. This will keep the generated java source during translation. Make sure the bean instantiation is in a try-catch which catches ClassNotFoundException. Tomcat catches this exception and throws an InstantiationException. -- padhu Jan Arenö wrote: Hi I have a problem. I'm trying to use the %@ page errorPage=error.jsp% on my page. This is the code %@ page errorPage=error.jsp% % if(5(0 5) { out.println(testar); } % Of course this generates an error and i'm thrown to the error.jsp page... But if I change the test page to: %@ page errorPage=error.jsp% jsp:useBean id=conn class=UnknownBean/ and UnknownBean is a non excisting class, I get an error and is not thrown to the error.jsp page, why not? [ERROR MSG] oracle.jsp.parse.JspParseException: Line # 2, Error: Unable to find class for bean: conn defined by tag with class: UnknownBean I'm running an Oracle with an preinstalled Apache/TomCat(?)/JSP server... Sometimes when I change some of my jsp files or update my class files the PATH is going down for some pages and they cant find their beans. I need a errorpage that tells me that this have happend but I can't figure out how. If the errorhandler can't handle missing classes, how do I make a check that reports to me when and if I loose my beans? Thanks for any help -Jan === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: How to pass an integer array from a form to a JSP page
String[] strarr = request.getParameterValues(param_name); Then use Integer.parseInt on each of these array elements. -- padhu C. Orlando Monzon wrote: When I pass an integer I use: int n = Integer.parseInt(request.parameter(field_name)); but I do not know how to pass an array such int[] n. Also in my JavaScript and can create an array. But how can I assign the array to one of the values of the form that are going to pass to a JSP page? So far I have in the javascript section var display = new Array(50); and in the final function for submit the form and have the statement document.form_name.field_name.value = display I do not know if this is correct because I can not have success passing this to my JSP page. Your help is very appreciated. Orlando === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: How to pass an integer array from a form to a JSP page
Didnt read the question correctly. Yep, your suggestion is the way to go. -- padhu Amit Ghaste wrote: u can assign it to a hidden field and then parse the string, then use the induvidual strings to convert to ints. i dont think u can assign a array like that to a field value(java script)... were u able to do that ??? padhu:: another thing... he does not have a bunch of parameters containing the same name so he cannot use getParameterValues... if he had a bunch of fields in which he had stored his indvidual values. he could do that. Suggestion:: in ur javascript parse ur array to a comma seperated value and assign it to a hidden field then at the jsp get the parameter as usual and parse the single string into multiple strings... using stringparser and then parse it to int hope that helps amit -Original Message- From: A mailing list about Java Server Pages specification and reference [mailto:JSP-INTEREST;JAVA.SUN.COM]On Behalf Of Padhu Vinirs Sent: Wednesday, October 30, 2002 3:01 PM To: [EMAIL PROTECTED] Subject: Re: How to pass an integer array from a form to a JSP page String[] strarr = request.getParameterValues(param_name); Then use Integer.parseInt on each of these array elements. -- padhu C. Orlando Monzon wrote: When I pass an integer I use: int n = Integer.parseInt(request.parameter(field_name)); but I do not know how to pass an array such int[] n. Also in my JavaScript and can create an array. But how can I assign the array to one of the values of the form that are going to pass to a JSP page? So far I have in the javascript section var display = new Array(50); and in the final function for submit the form and have the statement document.form_name.field_name.value = display I do not know if this is correct because I can not have success passing this to my JSP page. Your help is very appreciated. Orlando === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
web application design question...
I am planning on designing a web app. This web app basically has one look and feel ( like an amazon.com ) but where the contents change ( including images, amount of text/links etc ) depending on user choices. I am aware of Struts framework and the Front controller design pattern. I think Struts might be overkill because of the same look and feel across the webapp. My question is: Should the look and feel be : 1. managed by one jsp page which calls different controller objects ( which print portions of the UI ) 2. one jsp page which calls different controller objects which update javabeans, which in turn the main jsp page renders. So all rendering is done by only one jsp page, which acts as the front controller also. 3. one jsp page, which includes different jsp pages depending on the requirements. The smaller jsp pages inturn call controller objects, read from model/javabeans etc to render the UI. The main jsp page acts as the front controller. I prefer (3), but making sure the different JSP pages maintain the same look-and-feel standard is going to be tricky. I would like to hear comments from anybody who has designed similar projects. Also any good book recommendations is appreciated. Thanks -- padhu === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: User log from JSP
If you dont want to do a search, you could just log the info ( call ServletContext.log() ). If not, you could collect the info in a context attribute, and periodically submit all the requests ( like once in 4 hours ) together to a database. -- padhu Campano, Troy wrote: I want to track each page a user goes to in a database from my JSP web app. What I use to do is at the top of every page I would capture the user and page information and do an insert into the database. But it seems that doing an insert into the database on every page load might be a little inefficient. Does anyone have an idea on how to capture these stats? thank you! ~ Troy Campano = To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
thread safety test...
This is a small jsp page I am testing to understand theisThreadSafe attribute. I observe two strange things with Tomcat 4.1.12: 1. The code generated when isThreadSafe is set to true or false is the same. ( new code is generated with each change ). How can code generated for these two cases be the same ? 2. On Netscape 7.0 ( mozilla ), if I open 2 windows side-by-side, and make calls, Netscape finishes the call of one window before starting the call of another window. Looks like mozilla is checking to see if the url's are the same and then waiting ??? IE makes simultaneous calls and hence the print values differ. Anybody else notice this. Can anybody give some pointers for question 1 ? here is the jsp code: htmlbody %@ page isThreadSafe=true % %! int j=0; % % for(int i=0; i = 10; i++ ) { out.print(Value of j is + j + br/); j++; Thread.currentThread().sleep(3000); } % /body/html Thanks -- padhu === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: Connection to database from jsp.
Override jspInit() in a declaration block, create the connection, and save it as an attribute in ServletContext. -- padhu Anoop Kumar V wrote: We have a system consisting of a group of jsps - which have links to one another. There is no controller servlet as it is a simple system. What i want is to access the database from the jsps. The problem is that I do not want a new connection to be established everytime a request is made. What is the solution for this? I had initially thought of having a utility class and in that I can have a getConnection method which returns the connection to a static connection reference in the same utility class. This can then be assigned to the jsps (by making a call from the jsps to some method - returnConn, in the utilily class). Is it true that a new connection will be established everytime. This has confused me a bit. I am infact confused now about the very concept of static references. How do you think this problem can be solved? Will a servlet be of any use? Actually in a servlet, if we have a static connection reference as a class variable, and the initialization is done ( acquiring a connection) in the init method ( as init is executed only once in the lifetime of a servlet), the problem may be solved. In a servlet, the init method is executed only once and the servlet does not go out of memory till the server comes down. So I presume the connection will also be the same. Is this correct? Even if it is, I want to avoid the servlet, as it will be a lot of rework if the servlet has to be fit in. The application would have to be changed. Suggestions invited. Anoop Kumar V. === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: Moving client from one web app into another
why two webapps ? In your web.xml, why not create a security-constraint element, with web-resource-collection for all your secure pages, in the user-data-constraint set the transport-guarantee as CONFIDENTIAL. Then https has to be used for all your secure pages. -- padhu Joel Carklin wrote: Hi, I'm not sure what to do here, I have a general set of jsp pages open to the public, these are in a webapp with its own web-inf directory, classes etc. Then I have a secure webapp, starting with a logon page which you get to from a link in the 'public' website. The secure part of the site uses certificates and ssl and is a self-contained web-app, also with its own web-inf etc. My question I guess is this, can I deploy two or more web applications in the same container at the same time? Would I give each one a different port (connector) in the same Service (in the server.xml), or would each require it's own 'Service' tag altogether? or what? Sorry if my question is confusing, or if I'm making complicated things out of something simple, I'm just a bit confused. Thanks Joel === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: Strange number formatting behavior
Float and Double arithmetic is only approximate. Try using BigDecimal. -- padhu Kenny G. Dubuisson, Jr. wrote: I am trying to output number in a formatted style and keep having strange behavior. If I just output the float value, I get 9.9 for example. If I format it to 3 decimals, I get 9.912; it's adding values that aren't there in the actual number. Here is what I get NumberFormat form = NumberFormat.getInstance(); form.setMinimumIntegerDigits = 1; form.setMinimumFractionDigits = 3; form.setMaximumFractionDigits = 3; float myNumber = 9.9; String myNumberFormatted = form.format(myNumber); //Output is 9.912 This absolutely makes no sense. Anyone got any ideas? Thanks, Kenny === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: Strange number formatting behavior
try this: public class TestFloat { public static void main(String[] args) { float f1 = 1.0f; float f2 = 0.9f; System.out.println(f1 - f2); } } -- pady Conyers, Dwayne wrote: Padhu Vinirs [mailto:[EMAIL PROTECTED]] wrote: Float and Double arithmetic is only approximate. Try using BigDecimal. Yow... I never read that anywhere. That is good information. Is it documented *anywhere* ?? Dwacon www.dwacon.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com