Re: Disabling Ctrl+N Avoid new window....
On 19 Jun 2003 at 0:00, Automatic digest processor wrote: Subject: Re: Disabling Ctrl+N Avoid new window Hi, How to disable Ctrl+N operation which creates a new window in Browser ( IE ) My spontaneous reaction to that is, don't do it. If you feel that whatever you are doing needs to force the user to not open more windows, chances are that our program model are flawed. The original poster didn't say why he wanted to disable Ctrl+N, but I can see a good reason why he might. The problem has to do with session management. If you start two browser windows from the desktop or command line, you can automatically maintain two different session cookies, one for each window. But if you use Ctrl+N, you automatically get one session cookie for both windows. In that circumstance it can be very easy to confuse the server in any kind of stateful process. What we're trying to prevent here is not multiple windows, but multiple windows sharing the same session identification. One may argue that stateful processes are undesirable. Agreed. But sometimes they are absolutely unavoidable. So if anyone knows how to disable Ctrl+N, I'd like to hear it too. -- Alan Meyer AM Systems, Inc. Randallstown, MD USA [EMAIL PROTECTED] === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com
Re: JSP-INTEREST Digest - 13 Mar 2003 to 14 Mar 2003 (#2003-71)
On 15 Mar 2003 at 0:00, Automatic digest processor wrote: From:Snehal Pandya [EMAIL PROTECTED] Subject: confused I am working with a small application. I have 3 files. first is connection.java for JDBC Connection custSql.java for sql statements this the error message Error: 500 Location: /wip/CustMaster.jsp Internal Servlet Error: java.lang.IllegalStateException: Response has already been committed at org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServ letResp onseFacade.java:157) I don't know what went wrong here, but here's a hint. I have seen this error when I attempted to forward to another page after already writing output, for example, by calling out.write(). In my case, the error meant that I was, in effect, attempting to cancel output to the client that had already been committed. Hope that helps. -- Alan Meyer AM Systems, Inc. Randallstown, MD, USA [EMAIL PROTECTED] === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com
Closing a ResultSet, was Re: odd oracle error
Cosmin Cremarenco [EMAIL PROTECTED] wrote: I agree that the Statement and the PreparedStatement must be explicitly closed. But what about the ResultSet. How come the following piece of code works? ... According to the SDK v1.4.1 API documentation for the ResultSet interface: A ResultSet object is automatically closed when the Statement object that generated it is closed, re-executed, or used to retrieve the next result from a sequence of multiple results. So, assuming that Oracle and other have implemented the interface correctly, which I presume they have, there should be no need to close the ResultSet if the Statement is closed. There should not be a resource leak. --- Alan Meyer AM Systems Randallstown, MD U.S.A. === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com
Re: java + oracle question ?
On 22 Jan 2003 at 0:00, sufi malak [EMAIL PROTECTED] wrote: import java.sql.*; public class JDBCExample { public static void main(String[] args) { try { Class.forName(oracle.jdbc.driver.OracleDriver); Connection conn = DriverManager.getConnection( jdbc:oracle:thin:@majid:1521:test, scott, tiger); System.out.println(Got connected); ... In addition to the suggestions to add classes.zip to lib directory, I would have put a little more infrastructure here to make sure the driver is known to the driver manager. Specifically: try { // Load the driver class Class drvr = Class.forName(oracle.jdbc.driver.OracleDriver); // Register reference to the loaded class with the driver mgr DriverManager.registerDriver(drvr); // Get a connection Connection conn = ... ... } ... Hope that helps. --- Alan Meyer AM Systems Randallstown, MD U.S.A. === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com
Re: insert retrieve (text, image) jsp oracle ??
snip 1)how to do it in JSP ? See the getBlob method in the ResultSet object of the JDBC API 2.0. Pranav My own experience with trying to store and retrieve binary data from Oracle was very painful. What I discovered was that there are different ways to do it, many of which ALMOST work, or work if the data is not too large. I believe there is a method in one of the Oracle classes that will do it. I wanted to stay away from that and just use JDBC. What I wound up doing was: Declare the binary data column as LONG RAW. Get it via a SELECT into a ResultSet. Create a new InputStream from resultSet.getBinaryStream(column_no). Create a new ObjectInputStream on it. Read from the ObjectInputStream. What you do after that is up to you. I went through many painful experiments before finding this method. Good luck with it. -- Alan Meyer AM Systems, Inc. Randallstown, MD, USA [EMAIL PROTECTED] === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com
Re: session timeout setting
Yong How showed how to do this by setting a value in the web.xml configuration file. Another way to do it is is to make the following method call inside the application (allowing different intervals for different purposes): session.setMaxInactiveInterval (...) where ... is the number of seconds between interactions after which a timeout should occur. For two hours, you'd use 7200. You can set this in the login JSP page. Also, instead of reading the cookie, you might have a look at session.getId(), which should work with cookies or with URL re- writing, and session.isNew(). If I remember correctly, there might have been problems with these in Tomcat 3.x series that were fixed in 4.x. Alan -Original Message- From: A mailing list about Java Server Pages specification and reference [mailto:[EMAIL PROTECTED]]On Behalf Of Kenny G. Dubuisson, Jr. Sent: Wednesday, 18 December, 2002 12:11 AM To: [EMAIL PROTECTED] Subject: session timeout setting I have a site written in JSP that uses session info to validate user's sessions. I want to change the default timeout of the session from 60 mins but I'm not sure what is controlling this or how/where to change it. Here is more info to help figure this out...if anyone has any ideas I would greatly appreciate it. My initial JSP page has a login which, when validated, sets a cookie that stores the session ID. Every page thereafter, upon initial load, checks the current session ID against this cookie and if they don't match, the user is directed to re-login. My users want a longer timeout but I'm not sure where to control this (maybe this question is for the Tomcat listI just don't know). -- Alan Meyer AM Systems, Inc. Randallstown, MD USA [EMAIL PROTECTED] === 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: JSP 1.2 and XML Syntax
and the line it's croking on is: a href=jsp:expressionresponse.encodeURL(logout- action.do)/jsp:expressionLogout/a Looks to me like you're using double quotes incorrectly. Try using single quotes for the outer quotation. href='jsp:expressionresponse.encodeURL(logout- action.do)/jsp:expression'Logout/a -- Alan Meyer AM Systems, Inc. Randallstown, MD, USA [EMAIL PROTECTED] === 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
JDBCStore in Tomcat, or other save session techniques?
I am porting a Tomcat 4.03 JSP application to a new installation that has a hardware switch (BIG-IP) routing requests to multiple CPUs. The switch checks the incoming IP address and routes the user to the same computer he used previously, but only if he comes back within a half hour. After that his request is routed randomly to the next available server. The application uses session variables to save data, and sessions can last more than a half hour. So I wrote some code to serialize the session variables and store them in a database (a story in itself). However, I'm getting occasional ConcurrentModificationExceptions, which makes me wonder if Tomcat is updating the session object from another thread at the same time as I am (though maybe not, there's probably another explanation for this and if anyone has one, please speak up!) In any case, while perusing through Tomcat source code and Catalina Javadocs I found a JDBCStore class which seems to do exactly what I'm trying to do. My questions are: 1. Should application developers use this class? 2. If not, is there a higher level interface that should be used? 3. Is there a better way to do what I'm trying to do? Thanks. -- Alan Meyer AM Systems, Inc. Randallstown, MD, USA [EMAIL PROTECTED] === 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
File System on Linux
On 3 Jul 2002, at 0:00, Automatic digest processor wrote: ... snip ... So how should this file format be send to Linux server. Ex c:/example.txt interpreted by Linux ? Do I need to modify this so that Linux can understand ? Yes you do. I'm not sitting at a Linux system at the moment so I can't check this, but you have to find out where the Windows c: disk is mounted in the Linux file system. If I remember correctly, you need to look at the file named /etc/fstab, i.e., the file system table. It has (or needs to have) an entry that tells Linux what hard disk partition (e.g., hda1, or whatever) contains the Windows C: drive and gives a Linux name to it, which could be /C, /mnt/WindowsC, /DOS or who knows what. The names are arbitrary. If you don't know what I'm talking about, you'll have to look at the Linux file system documentation. Read the man pages for the mount command and the documentation for hard disk partitioning. Assuming that your file is called c:\example.txt in Windows and your Windows primary partition were mounted at a point named /DosC, then the access would be /DosC/example.txt. Also, you should be aware of any permissions issues on the windows file system. The files on the Windows partitions may have restricted read or write permissions with respect to ordinary (non-root) users. -- Alan Meyer AM Systems, Inc. Randallstown, MD, USA [EMAIL PROTECTED] === 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: [ann] WebWork 1.0 released
Rickard [EMAIL PROTECTED] wrote: I'm proud to announce the release of WebWork 1.0! WebWork is a HMVC web application framework in Java, developed as Open Source (BSD license) and designed to help create dynamic websites using minimal effort and maximum flexibility. It's architecture is easy to learn and understand, yet has features that allow for complex applications to be built. I haven't tried this yet, but I would nevertheless like to say Thank you to all of the developers who worked on the project. Writing open source software is a great way that people can make excellent use of their innate talents and hard won skills to give something to the world as a whole. My own efforts, both as a professional programmer and as an ordinary computer user, would be significantly harder and less interesting without the many superb open source tools that I use on a regular basis. As for the issue of Struts vs. WebWork vs. something else, I suspect that even if WebWork does not acquire a large user base, if it has good ideas in it (and I'm sure it does), people will see them and those ideas will work their way into other programs as well. The intellectual efforts made by each open source programmer contribute to the community even if their own specific programs never find many users. I'm sure that, in at least some areas, WebWork will raise the bar and help make all related projects better. Thanks again. -- Alan Meyer AM Systems, Inc. Randallstown, MD, USA [EMAIL PROTECTED] === 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