JSP-Servlet Question
Hi All, Has anyone tried using a servlet within a JSP? I have a set of servlets that generate HTML snippets that should integrate with the JSP page from which they are invoked. Any leads on this would be more than welcome. Thanks Vinay === 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
JSP-Servler Question 2
Hi All, I did get a few answers to a question I had posted about embedding servlet output in a JSP page. I guess I need to restate the requirement! I am developing a few servlets that would generate HTML code snippets - might not be complete HTML pages. The output of these servlets should merge with whatever HTML the JSP pages would produce. For instance if the JSP page had only the HTML and the HEAD tags and the servlets produce the BODY tag and its contents, the 2 need to be merged and displayed. I tried stuff like This compiles fine but does not produce the desired results! I would really appreciate if it is feasible to do thie WITHOUT resorting to using beans. Vinay === 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
JSP-useBean
Hi! I am new to using Java Beans in JSP. I have the following line of code for the Bean instantiation and am trying to get a property Sample on the bean. For this I tried <% mybean.getSample(); %> Doesn't seem to work! Has anyone faced this problem? Also, when I try to add the page directive at the top, <%@ page import="java.util.*, java.lang.*" %> it gives me, Error getting compiled page. 1,11: Attribute page has no value. Can someone tell me what is it that I am doing wrong. I am using Netscape Enterprise Edition 3.61 as my WebServer and Websphere 2.0.3 as my Application Server. Thanks for you time. Vinay === 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 to insert a filed consisting of single quote in msaccess?
Hi! Why don't you just find and replace all single quotes (') with 2 single quotes (''). Works fine with Oracle and MS SQL Server! Vinay -Original Message- From: Scott Evans [mailto:[EMAIL PROTECTED]] Sent: Monday, June 05, 2000 6:46 PM To: [EMAIL PROTECTED] Subject:Re: how to insert a filed consisting of single quote in msaccess? PreparedStatements automatically escape quotes and other problematic characters in the form that your database expects them to be escaped. Otherwise, you have to do it by hand, and you may have to change how you escape some things if you change your database. Note that this won't protect you from users embedding html tags in your forms which can mess up your jsp output. Scott Evans -Original Message- From: Khem Chand Sachdeva [mailto:[EMAIL PROTECTED]] Sent: Monday, June 05, 2000 12:07 PM To: [EMAIL PROTECTED] Subject:Re: how to insert a filed consisting of single quote in msaccess? how exactly using PreparedStatement will help in this case hoping for a answer, khem, Kishore Raghavan wrote: > Wensj, > > You do lot of effort in getting rid of characters like quotes etc... How > many such characters will you keep replacing ??? > > Use PreparedStatements in your inserts. All your problems will get solved > automatically. Tap the power of JDBC please > > Kishore Raghavan > > -Original Message- > From: A mailing list about Java Server Pages specification and reference > [mailto:[EMAIL PROTECTED]]On Behalf Of wensj > Sent: Monday, June 05, 2000 2:23 AM > To: [EMAIL PROTECTED] > Subject: Re: how to insert a filed consisting of single quote in > msaccess? > > hi: > i'm met this question,this because your text field include character > "\'". > in SQL statement,it's look as separater. >eg: when you insert "b'day" as the third field into table. > SQL statement is:insert into table values('aa','bb','b'day'.) > at this time, it cause SQLException: "comma wanting"; > how can we aviod this problem? > i'm througth two ways > one is: not permit input "\'" at text field. > the other is: before insert,use other character replace it. > eg: ><% String tmpstr=request.getParameter("strwithspe"); > tmpstr=tmpstr.replace("\'","~"); > %> > user "~" replace "\'", > when you get data from database,you must replace character "~" with > "\'". > > ok? > > - Original Message - > From: Kotireddy Mutyam <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, June 05, 2000 3:56 PM > Subject: how to insert a filed consisting of single quote in msaccess? > > > hi friends, > > I am working on JSP using JRun with MSAccess as a Database. > > I am not able to insert a field for example if i enter the value in text > > field like "b'day" it is throwing exception. How to overcome the > > error? > > TIA > > kotireddy > > [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 > > === > 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
Passing spaces in query strings
Hi all! I am having a problem passing parameters with spaces in the middle to servlets. I tried encodeUrl but it does not seem to encode the spaces with +'s. So I looked up the archive and found that I could use the URLEncoder.encode method. Well, this method seems to be working fine as far as converting the spaces to +'s go but when I try to do an encodeUrl of that string and a sendRedirect it seems to be failing. Here is what I am trying to do, response.sendRedirect(response.encodeUrl(java.net.URLEncoder.encode(sURL))); And for one of the cases with spaces here is what I get, 500 Internal Server Error The servlet named invoker at the requested URL http://localhost/servlet/polyx.application.FileDeleteServlet?AREAID=A1&DOCUM ENTID=4&FILENAME=Article+Writer+Functional+Specifications.doc reported this exception polyx.application.FileDeleteServlet?AREAID=A1&DOCUMENTID=4&FILENAME=Article+ Writer+Functional+Specifications.doc: polyx.application.FileDeleteServlet?AREAID=A1&DOCUMENTID=4&FILENAME=Article+ Writer+Functional+Specifications.doc. Please report this to the administrator of the web server when I click the URL[above url that comes in the error message] in the browser it works! Can somebody tell me how to go anbout handling spaces? IE seems to encode the URL directly without the use of the URLEncoder but including the URLEncoder.encode methid it does not work in IE either. Thanks and advance Vinay === 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