Re: Passing Value from one frame to another
"Mukka, Srikanth" wrote: > > Hi All, > > I have two frames,frame1 and frame2, I am displaying one a.html in frame1 > and b.html in frame2. User selected value from the list box from a.html and > depending on the value selected in a.html, I want to display the values in > frame two using b.html. I question is how do I pass values in this scenerio. > May be this is a small doubt. > Use javascript -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: auto-compile of JSP
ninewest wrote: > > I'm working on some software that creates/deploys JSP files automatically > from an external source. Some servlet/app server engines (ie Weblogic, > others?) > have flags that allow the engine to compile all JSP files on startup. However, > if new JSP files are put down while the engine is up, the first compile happens > on the first access. > > Is there anyone who has figured out some trick to cause the JSP to be > compiled before the first real web access, or > dispatch.forward()/dispatch.include() > method? > > I'm thinking that even if there is a way, it will be app server specific > but I figured > I would ask. You could run a servlet on startup that checks all jsp files to see wether tey have been touched and then does a request for the page if it has been touched. sven -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: errror when compilation
Camilla Straubel wrote: > > Hi > > When a compilationerror in the jsp-page exists the error page (that I have > specified) are not called. Is there a way to do this? > A compilation error is just that, a compilation error. Since the server is not able to compile the page correctly and create the servlet, it shows the message. AFIK there is no way around this. The error-page directive works from within the servlet. -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Dynamic Array Storage
Dennis Leary wrote: > > Tried to use the session object but. it wouldn't take. > > session.setAttribute(data, datalist) > > where datalist is datalist[][] > > I had error saying that HttpSession does not support it. > That's funny. Must be a bug somewhere in HttpSession.setAttribute(String, OBJECT). -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: How risky it is to store passwords in a session variable
T A Flores wrote: > > I think it would not necessarily be a dangerous thing to do. The > question you need to ask yourself is whether or not this is the right > thing to do. It is much easier to be security conscience then to add a > weakness to the system from the word go. I personnally would never > pass around a password. The previous message about the encrypted > password in the cookie is your best bet. I don't think so. Cookies get passed back and forth from server to browser and can be sniffed easilly. Cookies are good for simple sites (I don't really mind if someone rips my java-developer-connection password), but when you're talking a secure web site like a bank or some other financial institution, you really would not want to pass the passwords around in cookies. The good thing about session variables is that they stay withing the VM and are not easilly visible. The problem arises when they are serialized. Anyway the safest solution would be a quick connection to the database to retrieve the (hashed) password. sven -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: How risky it is to store passwords in a session variable
Michael Donnelly wrote: > > If you're worried about the session data being compromised or otherwise > stolen, you could just hash it. MD5 the user's password at login and store > the hash. Then when you need to re-prompt the user, hash the answer and > compare. That way the password can't be ripped off if someone finds a way > to get at that session data. > Sure it can, since most people still use dictionary words as a password... Anyway, storing an unhashed passowrd in the database is already a security risk. Especially is you allow the "I'm realy dumb and forgot my password and mail it to me" option on your site. -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: How risky it is to store passwords in a session variable
Lorena Carlo wrote: > > Hello all, Thanks for the answers, but you haven't really answer me if it is > dangerous to do this or not. The reason why I want to do this is for > validating a user after he has accessed the program, I want him to re-enter > the password for some operations, and I don't want to access again the > database, so I want to validate it with the session variable. > AFIK, if you store it in a session variable, it never sees the outside world, however, imho it's better to store some hashed version of the password in the session and make the comparisons against this hashed version than against the real password. Anyway, I wuld never store the password directly in the database if you're really concerned with security. Use something like a MD5 hash to store the password in the DB and then store the hash in the session, but DONT USE COOKIES to pass the password around. You might even want to store it in some bean using the transient modifier so the hash does not get serialized when your bean gets serialized, so if you have to check the user's passwordt and the password == null yopu'd have to go to the db to retrieve it again. sven -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: OK this is getting rather annoying ... List administratorpleaseread.
Navpreet wrote: > > I second all of whats written here and feel the same way! > Navpreet > Me too. But there is more.. I've seen people asking for a return reciept... -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Stored Procedures
Venu Gopal wrote: > > Hi Karau, > > Thanks for your reply.. > > I need to know a bit more on this.. > > 1. Which one will perform better in terms of getting > data from the database? The stored procedure one or > the JDBC query one? The stored procedure is supposedly better in performance. > 2. Will the stored procedure once executed need not be > executed again unlike the ordinary JDBC query (which > execute every time the program is invoked). Nope it works just as any query, it's just precompiled and optimized. > 3. What is the difference between prepared statement > (which is also a compiled SQL statement??) & stored > procedure? A Prepared Statement is something like any other query, but it's send to the rdbms to be precompiled and optimized and then awaits the parameters to be set after which it can be executed. It's faster in case you call the same query over and over again (using the same connection) ex when you're populatint the db with lot's of records. There might not be much of a preformance difference when you're using a simple select or update statement on one record and then close the connection or return it to the connection pool. sven -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Stored Procedures
"Karau, Joe" wrote: > > Stored procedures will be more efficient then using JDBC and directly > running queries. However, the difference may not be noticed unless a large > and complex query was performed. The reason that stored procedures are more > efficient, is that they are stored in the database as optimized queries. > Therefore, they do not need to go through the SQL optimizer, and often no > longer need to go through the SQL parser. The biggest problem with stored procedures however is portablilty. Using stored procedures, you have to redo all your sp's when you deploy on another database. It may be more efficient, but i prefer the portability. Besides, many rdbms cache the optimizations for queries and thus the difference may not be noticable anymore. sven -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Session Behaviour
Sundeep Goswami wrote: > > > I have been trying to understand why this is happening for the past two > days. Can someone please help me with this, > I am using iPlanet6.0 and iWS4.1 on NT. > I've seen this on the Inprise App Server list too. The response from Borland was that request.getSession(boolean) seemed to be broken in jsp1.1. You might try it without the boolean value. The url rewriting part is a setting in orion-web.xml: autoencode-urls = "false" sven -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: off-topic
Alper ASLAN wrote: > > bak uður kardeþ bu sorunu jsp intereste atma olum ... Bu applet problemi bak > rezil etme bizi tüm dünyaya ... > I'd like some of that too ;-) -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: cannot run jsp in tomcat
michael Smith wrote: > > Hi, > I just insatlled tomcat3.1 in windows 98, I can run the servlet examples at > http://localhost:8080/examples/ , but however I cannot run > the jsp examples, it give me classnot found errors int the tomcat console. > I have added JAVA_HOME and TOMCAT_HOME environmental variables > at the autoexec.bat script, can any body please tell me want happen? > thanks in advance! Make sure tools.jar from jdk can be found by tomcat. It needs this jar to compile the .jsp files. sven -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: including servlet output in jsp file
Tripat Kharbanda wrote: > what i am trying to do is to call servlet from the jsp page and get the > output generated by the servlet into that jsp file. for this purpose i > choose to use > > > > but this gives the following error in the browser window > > Included servlet error: 404: File Not Found > /jsp/maps/../../WEB-INF/servlets/OptionList > > but if i append ".class" to the servlet file path it displays the binary > code of the class file. That means that the path for the servlet is correct. > I'm a bit confsed about what you're trying to do here, but it seems to me that what you want is: bla bla This would call the servlet and include it's output in the HTML. Using jsp:include as you're trying to do it won't work since you have to work with the relative URL. try calling the servlet like this: sven -- ========== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: java function
Maciej Tylczyñski wrote: > > Hi > > I sthere any way to declare java function in jsp and then call it from > button's onClick method ? > Thanks No. sven -- ========== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: JDBC - recordcount
Joe Hanink wrote: > in a TYPE_SCROLL_SENSITIVE resultset, the record count could indeed change > during its lifetime, so I can see how this might impose some limitations on > its ability to know its size. Yet, for a TYPE_FORWARD_ONLY, there must then > be some other reason it is not built in. Does anyone expect this capability > to be available in JDBC 3? I don't think so. It's completely off-specs. The resultset is cached. It's size is <= FETCH_SIZE which means unless you move to the last row, there is no way to know the number of record sin the ResultSet beyond FETCH_SIZE. Sven -- ========== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: JDBC - recordcount
Neal Cabage wrote: > > Does anyone know how to return a recordCount when using JDBC? For instnace, > in ADO (Microsoft world) recordCount is simply a property of the recordSet > object. Is there something that provides a similar functionality? I need > that value *prior* to moving through the records so simply incrementing a > value is not an option. There is an option, but it's expensive. In JDBC the ResultSet is Cached, so effectively the number of rows is not known. However you can do: (Only with JDBC2 drivers and scrollable resultsets) int rows = 0; rs.last(); rows = rs.getRow(); rs.beforeFirst(); Much faster would be to do a "select count() from table where blablabla" before you get your resultset. sven -- ========== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] == === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: JSP and ASP
Selvamani Jayakumar wrote: > > hi > > You can get details about ASP+ at www.aspfree.com site. > According to information provided , developer can use > any lanuguage , this might be a advantage over JSP > Sure, as long as you only want to run on a M$ windooze supported platform. They may have improved over ASP, but they still have an enormous scalability problem. Using JSP as a frontend for a J2EE app, you can still develop on a pentium and deploy on a Sun Starfire for example with up to 64 processors. Try that with asp. sven -- ========== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Session ID HELP!!
Chad Pitt wrote: > > Hi there, > i have a question to ask..i tried to create the session on the first page(using >putValue() like you > suggested), and in my shopping list page i have a bean which i assigned as session >bean...surprisingly, > this session is bound to each other... i initially thought that it might turn out to >be 2 session > objects. or maybe i'm wrong , but it works ok when i tried to run on different >machine.. > is this because the machine assigns the session id for me to use no matter i assign >the bean as session or > i created it somewhereelse , it's gonna be the same number.. >maybe you can explain me a bit more what is > > going on behind.. thank you so much Dont you think the word "session" explains it all? Sven -- ============== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Dynamic population of list box
Hi Eoin, > . I am just not clear how to dynamically populate a list box so that the > user may select one and then I can use the selected value to retrieve that > employee's information. Heres a code snippet: <% for (int i = 0; i < clientes.size(); i++){ clienteBean.select(((Integer)clientes.get(i)).intValue()); %> <%=clienteBean.getNome()%> <% } %> In this case, I retrieved the pri key for my clients as an ArrayList(clientes) from my EJB. sven -- ========== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: EJB cached
> > Here it is: > I have an EJB that creates a product from a database.For e.g. takes its > part nos, price etc. > But it so happened that when we changed the price in the DB, the change did > not take affect in the JSP until we restarted the server. > > I am sure this has to do with caching/pool of the bean. so can you throw > some light on how to tell the bean that the db IS MODIFIED. Either your jsp's are cached. Try to use the meta no-cach etc, to resolve this. If it's bean related, it might depend on the vendor implementation of the container you're using. It might also be that the ejb is an entity bean, which again might depend on the vendor implementation. sven -- ========== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Comments for C# / VB Gen Next?
abhishek shodhan wrote: > > Java survives on its Web Related Technologies mainly. Nope java survives based on the fact that it is scalable and more or less platform independent. C# == M$ only > What about Java? The need for speed might take over, or will it? SUN is improving the JVM. sven -- ====== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: who is the leader : Tomcat, Resin, orion, websphere ????
"RICHARDSON-SIMON (IT)" wrote: > > Is there a link for orion / resin? www.orion.com -- ============== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: who is the leader : Tomcat, Resin, orion, websphere ????
Jonas Larsson wrote: > > My absoulute favourite is orion since it is as fast as resin (at least) and it is >always the first application server to implement the latest specs.. And ofcourse, it >is a full application server including EJB (1.1 and 2.0 Public Draft), JMS, JSP. And >it doesn't rely on anything else than standards! The docs could be better though. sven -- ============== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Using Runtime.getRuntime().exec() function
Ritesh_Srivastava wrote: > > Runtime.getRuntime().exec("notepad") works but > Runtime.getRuntime().exec("java ApplicationName") does not works. > Create a batch file that cd's to the startup dir os the java app, and then calls "java appname". Then in your app call the batchfile. sven -- ========== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: howto get Number of rows
Paras Sharma wrote: > > hi > > can some tell me when we access database how to get the number of rows > in table like the sql statement is > > select * from tablename; > rset.last(); rset.getRow(); sven ============== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Image Size (+ code)
anderson wrote: > > My database contains a field that has the name and path of an image (Gif or JPG ), I > need to show the image inside the window, and this window must have the same width > and height of the image. To do it I need to get the image size with the JSP. > That's exactly what I need. I'm trying to write some code that checks for the image width and height. It works perfectly for GIF type images but I can't get it to work for JPEG. any ideas ? : import java.io.*; import br.vip.util.LogWriter; public class ImageSizer extends Object { private int _height; private int _width; private int _type; // 1 denotes gif, 2 denotes jpeg private String _name; private File _f; private LogWriter _log; public ImageSizer(File f) throws IOException, FileNotFoundException, Exception{ _name = f.getName(); _f = f; _log = log; setType(); setSize(); } private void setType() throws IOException, FileNotFoundException{ String ext = _name.substring(_name.length() - 3, _name.length()); if (ext.equals("gif")){ _type = 1; } else if (ext.equals("jpg")){ _log.log("set Type JPG", LogWriter.DEBUG); _type = 2; } else { throw new IOException("Invalid Image Format!"); } } private void setSize() throws IOException, FileNotFoundException, Exception{ switch(_type){ case 1:{ sizeGIF(); break; } case 2:{ _log.log("setSize(2)", LogWriter.ERROR); sizeJPEG(); break; } } } private void sizeGIF() throws IOException, FileNotFoundException{ byte a[] = new byte[2]; FileInputStream img = new FileInputStream(_f); img.skip(6L); img.read(a); _width = ((short)a[0] | ((short)a[1])<<8); img.read(a); _height = ((short)a[0] | ((short)a[1])<<8); } private void sizeJPEG() throws IOException, FileNotFoundException, Exception{ byte a[] = new byte[2]; int marker = 0; FileInputStream img = new FileInputStream(_f); if (img.read() != 0xFF){ throw new Exception("Not a JPEG Header!"); } if (img.read() != 0xD8){ throw new Exception("Not a JPEG Header!"); } for (;;){ marker = getNextMarker(img); switch(marker){ case 0xC0: case 0xC1: case 0xC2: case 0xC3: case 0xC5: case 0xC6: case 0xC7: case 0xC9: case 0xCA: case 0xCB: case 0xCD: case 0xCE: case 0xCF:{ _log.log("Executing case: " + Integer.toHexString(marker) , LogWriter.ERROR); img.skip(3); img.read(a); _height = (((short)a[0]) << 8) + ((short) a[1]); img.read(a); _width = (((short)a[0]) << 8) + (short)a[1]; return; } } } } private int getNextMarker(FileInputStream img) throws IOException{ int c; c = img.read(); while (c != 0xff) { if ((c = img.read()) == -1){ return 0xD9; } } do { if ((c = img.read()) == -1) return 0xD9; } while (c == 0xff); return c; } public int getHeight(){ return _height; } public int getWidth(){ return _width; } } -- == Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: why bean can't have a constructor
Veena wrote: > > Bean can have a constuctor with no args... > It MUST have a constructor with no args. It may however have various constructors with lots of different args. These however will never be called when the bean is created by the http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: JavaScripts : Wanna disable viewing source of the page...
> > Not to run this 'silly' subject into the ground, but you could launch a > menu-less window with the gifs > and disable right-click. You forget TELNET, such a nice protocol. sven -- ========== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: any function in java.sql to give no of rows?
Medha Rangnekar wrote: > > I need to know the total no of rows a query returns in my JSP application. I > am new to JSP. I know that in ColdFusion there is such function like > queryname.recordcount I really consider that a necessary method which is missing. However you could do this: r.last(); r.getRow(); sven -- ========== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Sessions/Cookies do not work in IE5!!!!!!
Chris Ernenwein wrote: > > sessions work but not session = request.getSession(true); > > We got a new value each time it was called, if you look at the sessionID. > > We used session scope beans to hold data. Have you tried: <% HttpSession sess = request.getSession(); e.i. not request.getSession(true) session.putValue("Test", "Test Value"); %> from the JSP docs: (javax.servlet.jsp Class PageContext java.lang.Object | +--javax.servlet.jsp.PageContext ) getSession public abstract HttpSession getSession() Returns: the HttpSession for this PageContext or null As I understood from the docs, JSP always creates a session object. Hope this helps Sven -- ============== Sven van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] _/_ The answer / \ to the ultimate questionnnn|. .|nnn 42 =U === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Way to detect which browser
"Aggarwal, Pawan" wrote: > > Hi All, > > Is there any program which can detect what browser and what version is one > using... > so that to work out different javascript for them.. > Javascript === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Values Passing Through Session
> We have emptied the IE cache even it did'nt help. >Is there any thing wrong in our apporach? I wish somebody has > encountered this sort of problem. We have not been able to diagnose the root > cause. Is it the browser specific? I've seen the same problem. I think it's IE. It's cache is so dumb, it even caches error pages (404). sven === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Dynamic Contextual Menus Using Javascript
job job wrote: > > I need to be able to show dynamic contextual menus on mousedown using > Javascript. Is there a way to do this on Netscape and IE. > > Thanks, > > Rahul I think there is, I've just done this with menu's and buttons using a database. When the page is requested, several layers are added to the page. Just show the layer in the OnMouseDown event. sven === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: JSp debugger and EJB editor
Ritesh_Srivastava wrote: > > > Is there any debugger available for jsp pages. > > At the same time can anybody suggest about a good EJB editor. > > Forte has it all. Look at the sun site sven === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: uploading a file
Sivakumar Sankarasubramanian wrote: > > Hi , > > This automatically saves the file/files in the default root directory. > "." is the root and 5*1024*1024 indicates the max size of file. > I'm pressty new to JSP, but in servlets, I'd do exactly what you do in your jsp code. To place the file in the directory you want to specify, use File.renameTo() or use Runtime.getRuntime().exec() to use the os to move the file. I've seen that in some cases, for some reason File.renameTo() does not always seem to work(security issue?). sven === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets