RE: I post a text XML with Microsoft.XMLHTTP to servlet
Try to call your XML in the internet explorer and see if that xml have no errors.. It seems like the xml isn't well formed... Sincerely Erlis Vidal Santos -Original Message- From: Blackmore, John [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2003 9:22 AM To: '[EMAIL PROTECTED]' Subject: Re: I post a text XML with Microsoft.XMLHTTP to servlet Hi, I have the same problem. Can you elaborate on the ..., ie how to extract the XML string from the request? I've tried a few different methods without success. I'm running Tomcat 4.1.24-LE-jdk14 on Solaris. I have a servlet that clients post XML to. One client uses XMLHTTP object to do the post, and that's the one that's causing problems. All other clients are fine. I'd like to post the two approaches I've tried to resolve this, then maybe someone can tell me what I'm doing wrong or how to work around this? First, the simple, obvious approach - simply build a document from the input stream: DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document document = builder.parse(req.getInputStream()); When I try this, I get org.xml.sax.SAXParseException: Content is not allowed in prolog. Second, I tried to forcibly retrieve characters from the input stream, one by one. String xmlDocString = getXMLString((InputStream) req.getInputStream()); Document document = builder.parse(new StringBufferInputStream(xmlDocString)); Note: the getXMLString() function is not very interesting... simply has a loop as follows: while( (c=xmlInputStream.read()) 0 ) When I try this, I get the same error, however I don't get an empty string - xmlDocString has what looks like a URL encoded and truncated version of the original string. I would really appreciate any insight as to why this happens, even if a solution is not forthcoming. Thanks! John Blackmore - Howdy, You need to read the whole request into a String. Then, since you want a DOM document, use a DOM document builder to get it, e.g. String xmlInput = ... Reader reader = new Stringeader(xmlInput); InputSource inputSource = new InputSource(reader); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(inputSource) (The above are mixed imports from java.io, javax.xml.parsers, org.w3c.dom). Yoav Shapira Millennium ChemInformatics -Original Message- From: Jose Alanya [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 6:21 PM To: [EMAIL PROTECTED] Subject: I post a text XML with Microsoft.XMLHTTP to servlet Hi, I post a text XML with Microsoft.XMLHTTP to servlet, As I can recover the value of object request from of servlet This can : something like : Document oDocument = xml.paser(objrequest) Not getparameter, not getquerystring Please help me! Thanks, best regards, Jose Alanya From, Lima Peru ** This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited. Thank you for your compliance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
One solution to the problem with IIS and Tomcat 4.1.24 config
Hi all I got problem trying to configure tomcat4 and IIS. The problem was: When I configure steep by steep just like the iis-tomcat-howto explain to, the redirector sent itself like the resource to the tomcat container and as the result I got the ERROR 404 /Jakarta/isapi_redirect.dll is not available by the tomcat container After many ours I thought that maybe the problem was something wrong in the parameter that carry the resource. I remembered that I inserted something in the registry exactly equal to the resource that tomcat was trying to reach /jakarta/isapi_redirect.dll My solution: I read again the iis-tomcat-howto and I understand very well what I must to do, the important section of the iis-tomcat-howto is here: Using the IIS management console, add isapi_redirect.dll as a filter in your IIS/PWS web site. The name of the filter should reflect its task (I use the name jakarta), its executable must be our c:\jakarta-tomcat\bin\win32\i386\isapi_redirect.dll. For PWS,(*HERE IS WHERE I PUT ALL MY ATTENTION***) you'll need to use regedit and add/edit the Filter DLLs key under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\Parameters . This key contains a , separated list of dlls ( full paths ) - you need to insert the full path to isapi_redirect.dll. If you read carefully you can see that ...For PWS, you'll need to use regedit and add/edit the Filter DLLs... and I wasn't used PWS (Personal Web Server) I'm using IIS. Yeahp, when I remove the registry entry all was OK. I really hope you can resolve the problem if you still with that headache Sicerelly Lic. In Computer Science Erlis Alberto Vidal Santos
RE: String added to session in servlet not available in jsp
Can you please show how are you creating the session object??? Sincerely Lic. Computer Science Erlis Vidal Santos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 10:44 AM To: [EMAIL PROTECTED] Subject: String added to session in servlet not available in jsp Hi, I created a session object and added a string (username) to it. Systemout.println shows the username from the request. My page is then forwarded to another as follows: RequestDispatcher disp = ctx.getRequestDispatcher(target); disp.forward(request, response); On this jsp page, I have teh following code: String usr = (String)session.getAttribute(usr); out.println(User: + usr + !); out.println(Session Id: + session.getId()); The page displays the session Id but not the usr. I'm quite baffled at why this is the case. looking in google for similar problems, but any help would be much appreciated! Rudi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: String added to session in servlet not available in jsp
And how you get the session in your JSP?? Try this HttpSession session = request.getSession(true); String username = ( request.getParameter(username) != null ? request.getParameter(username) : ) ; session.setAttribute(usr, username); Sincerely Lic. Computer Science Erlis Vidal Santos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 10:54 AM To: Tomcat Users List Subject: RE: String added to session in servlet not available in jsp Can you please show how are you creating the session object??? No worries, here it is: HttpSession session = request.getSession(true); session.setAttribute(usr, request.getParameter(username)); Sincerely Lic. Computer Science Erlis Vidal Santos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 10:44 AM To: [EMAIL PROTECTED] Subject: String added to session in servlet not available in jsp Hi, I created a session object and added a string (username) to it. Systemout.println shows the username from the request. My page is then forwarded to another as follows: RequestDispatcher disp = ctx.getRequestDispatcher(target); disp.forward(request, response); On this jsp page, I have teh following code: String usr = (String)session.getAttribute(usr); out.println(User: + usr + !); out.println(Session Id: + session.getId()); The page displays the session Id but not the usr. I'm quite baffled at why this is the case. looking in google for similar problems, but any help would be much appreciated! Rudi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: String added to session in servlet not available in jsp
I really sorry the last message I sent it by mistake, is difficult to me write code in outlook ;) well Try this HttpSession session = request.getSession(true); String username = request.getParameter(username) if ( username == null ) username = noParameter; if ( .equals( username ) ) username = noParameter; session.setAttribute(usr, username); I'm thinking that your request parameter is empty.. Try this and tell us Sincerely Lic. Computer Science Erlis Vidal Santos -Original Message- From: DA-Erlis Vidal Sent: Thursday, October 09, 2003 11:02 AM To: 'Tomcat Users List' Subject: RE: String added to session in servlet not available in jsp And how you get the session in your JSP?? Try this HttpSession session = request.getSession(true); String username = ( request.getParameter(username) != null ? request.getParameter(username) : ) ; session.setAttribute(usr, username); Sincerely Lic. Computer Science Erlis Vidal Santos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 10:54 AM To: Tomcat Users List Subject: RE: String added to session in servlet not available in jsp Can you please show how are you creating the session object??? No worries, here it is: HttpSession session = request.getSession(true); session.setAttribute(usr, request.getParameter(username)); Sincerely Lic. Computer Science Erlis Vidal Santos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 10:44 AM To: [EMAIL PROTECTED] Subject: String added to session in servlet not available in jsp Hi, I created a session object and added a string (username) to it. Systemout.println shows the username from the request. My page is then forwarded to another as follows: RequestDispatcher disp = ctx.getRequestDispatcher(target); disp.forward(request, response); On this jsp page, I have teh following code: String usr = (String)session.getAttribute(usr); out.println(User: + usr + !); out.println(Session Id: + session.getId()); The page displays the session Id but not the usr. I'm quite baffled at why this is the case. looking in google for similar problems, but any help would be much appreciated! Rudi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Web-app setup
You only need to put your class files in the WEB-INF directory not the java files. Is your class file a Servlet??? Maybe is a mapped error in your web.xml include relevant part of it pls... Sincerely Erlis Vidal Santos -Original Message- From: Duane Kehoe [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 4:47 PM To: Tomcat Users List Subject: Web-app setup I am trying to setup a webapp and am having a little difficulty. My application starts on /webapps/myapp/index.jsp with 2 text fields(1 text, 1 password), this is a login type page, when the submit button is clicked on the jsp my class which is packaged into com.mycompany.myapp.Login comes back with a 404 status code everytime. I have created inside of the WEB-INF directory a classes/com/mycompany/myapp/ directory structure and placed both my java source and class files into this dir. As far as I can see everything looks right even my error points to the right dir structure however I continue to get requested resource not available errors, I think my web.xml is the issue however I am very new to tomcat and unable to find anything in the docs or mail list archives that help me. I am currently running Apache 2.0.46 with Tomcat 4.1.18 on Linux 2.4.20 kernel. Any help here would be great tia. -- /*Weyco** Group* -/ */Florsheim, Brass Boot, Nunn Bush, Stacy Adams/* Duane Kehoe EC / Programmer / Analyst Phone # 414.908.1814 Fax # 414.908.1601 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Web-app setup
Try this servlet-mapping servlet-nameLogin/servlet-name url-pattern/Login/url-pattern /servlet-mapping Sincerely Erlis Vidal Santos -Original Message- From: Duane Kehoe [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 5:03 PM To: Tomcat Users List Subject: Re: Web-app setup Sorry about that the whole web.xml is included. This is a very simple app(actually my second app ever, the first was a simple lookup(which worked)) so the web.xml that I have created thus far is very small ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//SUN Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameLogin/display-name descriptionmy little login app/description servlet servlet-nameLogin/servlet-name servlet-classcom.mycompany.myapp.Login/servlet-class /servlet servlet-mapping servlet-nameLogin/servlet-name url-pattern/myapp/com/mycompany/myapp/url-pattern /servlet-mapping /web-app Thanks again Lee, Paul NYC wrote: Can you include the relevant part of web.xml? -- /*Weyco** Group* -/ */Florsheim, Brass Boot, Nunn Bush, Stacy Adams/* Duane Kehoe EC / Programmer / Analyst Phone # 414.908.1814 Fax # 414.908.1601 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]