unsuscribe
RE: Template -struts-template and generated HTML / templating using PUSH model
Many Thanks. It works OK now under Tomcat 3.2.1. Is there a problem in "flush" under Tomcat 3.2.1; in this case this patch would be appreciate for final Struts 1.0. Or is it my Tomcat configuration ? Vincent. -Message d'origine- De : Assenza, Chris [mailto:[EMAIL PROTECTED]] Envoyé : mercredi 28 mars 2001 23:12 À : '[EMAIL PROTECTED]' Objet : RE: Template -struts-template and generated HTML / templating using PUSH model Harcq, I just ran into this problem myself with WebSphere. The GetTag.java - the source behind the template:get tag that actually does the include calls pageContext and includes whatever content should go in. By default, the servlet engine should flush the buffer (that's what allows an include to go somewhere within your page). However, apparently some servers don't do that by default (WS 3.5.3 doesn't seem to). The solution is an easy one, but you'll need to recompile Struts. Under struts/src/share/org/apache/struts/taglib/template you will see a file called GetTag.java. Open that file. In the doStartTag() method you'll find the following code: pageContext.include(content.toString()); To fix your problem (hopefully, worked for me) add the following line above it: pageContext.getOut().flush(); So your end result will look like: pageContext.getOut().flush(); pageContext.include(content.toString()); By hardcoding the flush your problems should be solved. Recompiling struts is documented on the Struts installation web page. :) HTH, Chris Assenza -Original Message- From: Vincent Harcq [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 2:59 AM To: User Struts Subject: Template -struts-template and generated HTML / templating using PUSH model Hi, 1. I am beginning to look at Templating mechanism and so use the example struts-template using version pre-beta-2 (23/03/01). The result is a strange for me. Can somebody explain me this. On the first page, when I look at the generated code (look at the end of message), I got something where the side-bar.jsp and header.jsp is included BEFORE the tag; while from what I see in chapterTemplate.jsp, the should appear first. Is there a problem somewhere ? Does somebody is aware of that ? Is it my browser ? 2. I was also thinking about another mean of doing templating. The fact that I have two create each 2 files (introduction.jsp and introduction.html) is not really needed if you consider you have a little number of different templates to work with. Say you have only two templates (side-bar header content footer) (left-bar header content right-bar footer), it is too much for me to create each time the page that will use template:put. I have done that before I used Struts in a "request processor" by setting the value of a "content" field, forwarding to one of two pages template1.jsp and template2.jsp that uses jsp include tags. My plan was to do that in the findForward() method of ActionForwards and forward all the time to one of the 2 template pages that I have and setting the "content" value before. To speak "philosophically", but wishing to not re-open this debate, the PUSH method is for me more convenient that the "PULL" one for Page Templating Mechanism. But I do not want to "mix" Velocity and Struts only""" to solve this templating problem. Any ideas ? HTML generated: --- Topics Introduction Using Templates Optional Content ... and more ... . . . _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: Pooling with Oracle database
excuse me that 'ori8' not ora8 > -Original Message- > From: malcolm davis [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 28, 2001 10:16 PM > To: [EMAIL PROTECTED] > Subject: RE: Pooling with Oracle database > > > Rafal, > > You might want to change from the thin to ora8. > 'ora8' was designed to be used for connection pooling. > The 'thin' driver was developed for applets. > > - malcolm > > > -Original Message- > > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 28, 2001 7:41 PM > > To: [EMAIL PROTECTED] > > Subject: Re: Pooling with Oracle database > > > > > > > > > > On Wed, 28 Mar 2001, Rafal Zakrzewski wrote: > > > > > Hello, > > > > > > How to encode one pool of connections for whole application ? > > > Should I encode this in some main servlet and then > receive connection > > > from this servlet ? > > > > > > In struts-config.xml I have a section: > > > > > >> >description="Trial access to database" > > > driverClass="oracle.jdbc.driver.OracleDriver" > > > maxCount="4" > > > minCount="2" > > > password="123" > > > url="jdbc:oracle:thin:@ado:1521:123" > > > user="123" /> > > > > > > > > > > > > > > > tnx > > > > > > > With this entry in struts-config.xml, Struts will create a single > > connection pool, and will also make it available in different ways: > > > > * If you have a reference to the controller servlet (as in > an Action), > > you can call servlet.findDataSource(null); > > > > * If you have access to the servlet context (as in a > different servlet > > in the same webapp), you can call > > getServletContext().getAttribute(Action.DATA_SOURCE_KEY); > > > > * In a custom tag implementation class, you can call > > pageContext.getAttribute(Action.DATA_SOURCE_KEY, > >PageContext.APPLICATION_SCOPE); > > > > * In a scriptlet embedded in a JSP page, you can call > > application.getAttribute(Action.DATA_SOURCE_KEY); > > > > In all of these cases you are referencing exactly the same > connection > > pool. > > > > Craig > >
init'ing a session bean in Action
Probably not the right group and I'm new to ejb's and am having a problem getting a sesson bean going from within an Action class (a class from the apache struts framework which probably doesn't make a difference what the class is). Is this on the right track to doing this correctly, though I get the following error. javax.naming.NameNotFoundException: ConfigHome not found at com.evermind.server.rmi.RMIContext.lookup(JAX, Compiled Code) at com.evermind.server.hm.f4(JAX, Compiled Code) at com.evermind.server.hm.lookup(JAX, Compiled Code) at javax.naming.InitialContext.lookup(InitialContext.java, Compiled Code) My Sesson bean is made up of the following:ConfigHome - home interfaceConfigBean - session beanConfig - ejbobject interface My ejb-jar.xml file looks like this. Configuration Session Bean com.neuroquest.cais.ejb.config.Config com.neuroquest.cais.ejb.config.ConfigHome com.neuroquest.cais.ejb.config.Config com.neuroquest.cais.ejb.config.ConfigBean Stateless Any help much appreciated. -- public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { String initCtxFactory = getInitParameter(Context.INITIAL_CONTEXT_FACTORY); String providerURL = getInitParameter(Context.PROVIDER_URL); try { Properties env = System.getProperties(); env.put(Context.INITIAL_CONTEXT_FACTORY, initCtxFactory); env.put(Context.PROVIDER_URL, providerURL); Context ctx = new InitialContext(env); ConfigHome home = (ConfigHome) ctx.lookup("ConfigHome"); ConfigBean cfgBean = home.create(); cfgBean.doMyMethod(); } catch (Exception e) { log(e); e.printStackTrace(); }
RE: Pooling with Oracle database
Rafal, You might want to change from the thin to ora8. 'ora8' was designed to be used for connection pooling. The 'thin' driver was developed for applets. - malcolm > -Original Message- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 28, 2001 7:41 PM > To: [EMAIL PROTECTED] > Subject: Re: Pooling with Oracle database > > > > > On Wed, 28 Mar 2001, Rafal Zakrzewski wrote: > > > Hello, > > > > How to encode one pool of connections for whole application ? > > Should I encode this in some main servlet and then receive connection > > from this servlet ? > > > > In struts-config.xml I have a section: > > > > >description="Trial access to database" > > driverClass="oracle.jdbc.driver.OracleDriver" > > maxCount="4" > > minCount="2" > > password="123" > > url="jdbc:oracle:thin:@ado:1521:123" > > user="123" /> > > > > > > > > > > tnx > > > > With this entry in struts-config.xml, Struts will create a single > connection pool, and will also make it available in different ways: > > * If you have a reference to the controller servlet (as in an Action), > you can call servlet.findDataSource(null); > > * If you have access to the servlet context (as in a different servlet > in the same webapp), you can call > getServletContext().getAttribute(Action.DATA_SOURCE_KEY); > > * In a custom tag implementation class, you can call > pageContext.getAttribute(Action.DATA_SOURCE_KEY, >PageContext.APPLICATION_SCOPE); > > * In a scriptlet embedded in a JSP page, you can call > application.getAttribute(Action.DATA_SOURCE_KEY); > > In all of these cases you are referencing exactly the same connection > pool. > > Craig >
Re: ActionForm with no default constructor
I think this should work. The most likely reason I can think of for what you're seeing is incorrect settings in your struts-config.xml file. You might want to check the following: 1) The 'name' in your must match the 'name' in your . 2) The 'scope' in your must be specified as "session" in your case. 3) The 'type' in your must be set to the actual class you are instantiating (even if Struts won't be able to instantiate one of those). 4) The attribute name under which you are storing your form bean must be the same as the 'attribute' in your , or the 'name' if you do not specify 'attribute'. Hope this helps. -- Martin Cooper - Original Message - From: "Joel Shellman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 27, 2001 5:53 PM Subject: ActionForm with no default constructor > Is it possible to use an ActionForm with no default constructor? Can the > form tag just get it out of my session? > > I want to grab the object from persistent store and put it in the > session (on a previous page before they get to the form). Then when they > actually access the page, the form can just grab the object out of the > session and use it as the ActionForm object for populating, posting, > etc. > > However, when I try that I get an error because it's trying to > instantiate a new ActionForm instead of using the one I already have for > it in the session. > > Any ideas on how I can get this to work? I have to use an object with no > default constructor because it requires credentials from the session in > order to be constructed. > > Thank you, > > Joel Shellman
Re: html:errors, how to keep html out of messages?
I made the equivalent of the errors tag, but it iterates through the error messages. or The header and footer are optional. http://home.earthlink.net/~dwinterfeldt David --- Maya Muchnik <[EMAIL PROTECTED]> wrote: > In struts-example resource file errors.header has > "" tag, and > errors.footer has "" tag. This reason why each > error message must to > have these pair tags. > Hope this help. > Maya > > Phillip Rhodes wrote: > > > I am using the html:errors tag to display my > messages, but I find that I > > have to wrap each of my message key values with a > for them to > > display properly. > > > > Is there a way that as I iterator through my > errors, that I could output > > the error message with the tag? > > > > Thanks! > __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text
Re: ActionForward and Frames
On Wed, 28 Mar 2001, Sean Giles wrote: > Is it possible to target a specific frame with an ActionForward? For > instance if I want to return to a search page that exists in a leftmost > frame if the target of the search results link was a contents frame? > Which frame the output goes to is determined by the "target" attribute on the or tag that submitted the request. Make sure you generate your hyperlinks and input forms with the appropriate value, and this should work. > > Thanks > Sean Craig McClanahan
Fun with
I'd like to translate the following to scriptlet-free JSP. (Hey, that rhymes!) String focus; if (request.getParameter("startAtTheTop") != null) { focus = "field1"; } else { focus = "field2"; } The main problem I'm facing is that I need to be able to use 'focus' as the value of a tag attribute later in the JSP, like so: That means that the following approach does not work: When it hits the expression in the tag, the JSP compiler complains that 'focus' is undefined. Presumably, this is because the JSP compiler doesn't realise, like we do, that one or the other of those cases will be executed, so that 'focus' will indeed be defined. In any case, the best I've been able to come up with so far is this: This works, but it does seem rather clumsy. Is there a better way? Thanks. -- Martin Cooper
RE: using struts in a load-balanced environement
On Wed, 28 Mar 2001, Kurt Olsen wrote: > It's been my impression that the bigger servers can maintain session across > webservers. I thought that when something was stuck in the session that it > must be Serializable and when session.setAttribute(x,y) was called that the > object was stashed somewhere, such as a ldap or database and keyed by > session id. > >From the point of view of your application, the servlet spec requires you to do the following to run in a load-balanced server: * Add a element to your web.xml file in the appropriate place. * Ensure that any session attribute you create implements Serializable. Some application servers impose an additional (non-spec) requirement that servlet context attributes must be Serializable as well. The requirement on the servlet container is that, at any point in time, all requests for the same session be handled inside the same JVM. Thus, your application level classes generally do not have to do anything special other than the above requirements. > At least I'm praying that something like this works when/if we get our app > to the server farm size. The details of whether and how this works depends very much on the application server you are running on. None of the rules are really specific to Struts -- they would affect any and all web apps run on that server. Check your server's docs on distributable applications for more info. > Kurt > Craig McClanahan
Re: Pooling with Oracle database
On Wed, 28 Mar 2001, Rafal Zakrzewski wrote: > Hello, > > How to encode one pool of connections for whole application ? > Should I encode this in some main servlet and then receive connection > from this servlet ? > > In struts-config.xml I have a section: > > description="Trial access to database" > driverClass="oracle.jdbc.driver.OracleDriver" > maxCount="4" > minCount="2" > password="123" > url="jdbc:oracle:thin:@ado:1521:123" > user="123" /> > > > > > tnx > With this entry in struts-config.xml, Struts will create a single connection pool, and will also make it available in different ways: * If you have a reference to the controller servlet (as in an Action), you can call servlet.findDataSource(null); * If you have access to the servlet context (as in a different servlet in the same webapp), you can call getServletContext().getAttribute(Action.DATA_SOURCE_KEY); * In a custom tag implementation class, you can call pageContext.getAttribute(Action.DATA_SOURCE_KEY, PageContext.APPLICATION_SCOPE); * In a scriptlet embedded in a JSP page, you can call application.getAttribute(Action.DATA_SOURCE_KEY); In all of these cases you are referencing exactly the same connection pool. Craig
RE: using struts in a load-balanced environement
Yes. High-end servlet engines will replicate session state between one or more servers in the cluster; to how many it gets replicated depends on the specific implementation. For example when you cluster Weblogic servers, each new session is assigned a primary server and a secondary server. All updates to the HttpSession are replicated from the primary to the secondary. The trick is though (and my understanding starts to get a little bit fuzzy at this point) that you can't hold a reference to an object stuffed into a particular client's HttpSession object, call a method on that object which changes its internal state, and expect the servlet engine to respond to this method call and replicate the state to the secondary server automatically. There are two approaches here: 1. Whenever you make a change to the state of an object held in a client's HttpSession, put the object back into the HttpSession with the same name and object reference. This is the simplest approach. An alternative approach. 2. Make your session state objects extend java.util.Observable. The servlet engine's implementation of HttpSession would have to then add itself as an observer to all new objects coming into the HttpSession. The session state object would have to call setChanged() and notifyObservers() in any 'mutator' methods in order to ensure that the servlet engine is told of the state change. The second approach would tie you to whatever servlet engine implements that functionality, and thinking harder about it, I don't think it buys you anything over the first approach anyway. If there was a thread running through all HttpSession's and periodically checking whether the Observable objects in them had changed their state then it wouldn't be necessary to call notifyObservers() - but you would also leave it in the lap of the gods as to when exactly the servlet engine gets a notification that the session state needs replicating, a failure in the meantime could result in lose of the client's state. Does anyone know if there are engines out there doing it this way? Regards, James W. -- 'A $16 million Cash Injection for Smart Card Business' click below http://www.cardsetc.com to read about Cards etc's success. -- This e-mail is from Cards Etc Pty Ltd (ACN: 069 533 302). It may contain privileged and confidential information. It is intended for the named recipient(s) only. If you are not an intended recipient, please notify us immediately by reply e-mail or by phone on +61 2 9212 7773 & delete this e-mail from your system. --
Re: Removing ActionForm's from context
On Wed, 28 Mar 2001, Joel Shellman wrote: > I don't quite understand the the below quote from the example tour. The > paragraph doesn't make sense. Anything in request scope will be removed > after the request is over automatically. So there's no need to remove it > just so if the user comes back later to the same page--it would have > been long gone before then. Right? What is it talking about? > In early versions of Struts, form beans could only be stored in session scope, so the Actions were programmed to remove those beans as soon as they were no longer needed. Once the support for using request scope was added, the example app was changed so that it will work correctly for *either* scope (request or session) for form beans. You are correct that the removeAttribute call is not required for request scope, but it doesn't hurt anything either -- and it is part of maintaining the compatibility so that this code will still work for session scope form beans. Craig
Re: Initial security check
On Wed, 28 Mar 2001 [EMAIL PROTECTED] wrote: > > > > Hi. Just one more question on this... > > If I find an error when I do the initial check in the controller (see history), > can I forward to an error page directly from the init() method? Is there a way > to do this elegantly? > The init() method is not called for a particular request (in fact, it is called *before* any request is allowed to be processed), so there is not really any option to forward control to an error page. Instead, you should throw a ServletException from the init() method. If the problem you ran into is temporary, you can also throw an UnavailableException instead, which gives you the option of saying how long the servlet container should wait before trying again. > Thanks, > > Dave > > Craig
Whats the point of and
Am I just not seeing it or what? Currently, this is what i'm doing: "> It would be great to do something like this: Would something like this be possible in the next coming version of struts? The same applies for the taglib for . Thanks!!
ActionForward and Frames
Is it possible to target a specific frame with an ActionForward? For instance if I want to return to a search page that exists in a leftmost frame if the target of the search results link was a contents frame? Thanks Sean -- Sean Giles, [EMAIL PROTECTED] on 03/28/2001
RE: using struts in a load-balanced environement
It's been my impression that the bigger servers can maintain session across webservers. I thought that when something was stuck in the session that it must be Serializable and when session.setAttribute(x,y) was called that the object was stashed somewhere, such as a ldap or database and keyed by session id. At least I'm praying that something like this works when/if we get our app to the server farm size. Kurt -Original Message- From: Doug Wright [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 2:50 PM To: [EMAIL PROTECTED] Subject: using struts in a load-balanced environement I am very curious about whether the struts framework could be applied in a 'load-balanced' or 'webserver-farm' environment. One of the main requirements of the application I am currently working on is that it function properly in such a distributed or load-balanced environment where each request may or may not come from the same web server. This obviously precludes us from using session and application scopes in the application. We have been using the database to maintain state, but it seems like a very inefficient and dirty solution. I would love to be able to use the model 2 architecture (and specifically the struts framework), but it seems like most of the benefits can only be had in an environment where the same web server will be used for each request (our load-balancers support 'sticky-sessions' but these rely on cookies and we don't want cookies to be a requirement for using the application). Am I missing something? Is there a way to effectively use struts and the session and application scope in a load-balanced environment? I greatly appreciate any advice that anyone has on this subject. ---DougWright
How to redirect to the input jsp page from the formbean's validate method instead of populating ActionErrors.
Hello, How do I redirect to the input jsp page from the formbean's validate method instead of populating ActionErrors. I knew redirecting from the perform method of the Action object, wondering is it possible to simulate the same from the validate method. Thanks in advance, Senthil Kumar.S ** The Information transmitted herewith is sensitive information intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
using struts in a load-balanced environement
I am very curious about whether the struts framework could be applied in a 'load-balanced' or 'webserver-farm' environment. One of the main requirements of the application I am currently working on is that it function properly in such a distributed or load-balanced environment where each request may or may not come from the same web server. This obviously precludes us from using session and application scopes in the application. We have been using the database to maintain state, but it seems like a very inefficient and dirty solution. I would love to be able to use the model 2 architecture (and specifically the struts framework), but it seems like most of the benefits can only be had in an environment where the same web server will be used for each request (our load-balancers support 'sticky-sessions' but these rely on cookies and we don't want cookies to be a requirement for using the application). Am I missing something? Is there a way to effectively use struts and the session and application scope in a load-balanced environment? I greatly appreciate any advice that anyone has on this subject. ---DougWright
Re: Struts in WebSphere - VICTORY !!!!!!! - Addendum
Thanks for posting this, Chris. I added it to the installation guide, and the Jyve FAQ. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/
Re: html:errors, how to keep html out of messages?
The tag generates output like this: (errors.header)CR-LF (message1)CR-LF (message2)CR-LF ... (messageN)CR-LF (errors.footer)CR-LF where the values in parentheses are keys into the application's properties file, and message1 through messageN are your error message keys. Since CR-LF is just whitespace in HTML, you have to either use (or , etc) in the messages themselves, or put your tag in a fixed-format block (e.g. ). Theoretically, you could grab the ActionErrors object from the request attribute in which it's stored, and iterate over the errors yourself, but then you have to get into looking the keys up in the right resource bundle, etc. If you really want to do something different, then I'm afraid all I can suggest is taking a look at ErrorsTag.java and perhaps writing your own tag based on that. -- Martin Cooper - Original Message - From: "Phillip Rhodes" <[EMAIL PROTECTED]> To: "struts-user-jakarta.apache.org" <[EMAIL PROTECTED]> Sent: Wednesday, March 28, 2001 12:35 PM Subject: html:errors, how to keep html out of messages? > I am using the html:errors tag to display my messages, but I find that I > have to wrap each of my message key values with a for them to > display properly. > > Is there a way that as I iterator through my errors, that I could output > the error message with the tag? > > Thanks! >
struts and cocoon
Hi all- I’ve been trying to get cocoon and struts together, however one is using the servlet.jar the other servlet_2_2.jar. Is it possible to combine these two? If you have an answer, please cc me at [EMAIL PROTECTED] since I can’t get listserver mail from work. Thanks!
CreateProcess
I am trying to get struts working for Weblogic 5.1 SP8. I am getting the error below. This doesn't seem to be the class cast exception I am seeing often in the archives here ( yes, I tried looking there first for an answer to this...I swear! ). Anyone have any idea? Do I need to do something in WLS to get WAR files to work properly? Thanks for any info, Will Compilation of 'D: \jakarta-struts\webapps\WEB-INF\_tmp_war_strutsexample\jsp_servlet\_index.java' failed: Failed to parse compiler output: java.io.IOException: CreateProcess: javac -classpath d: \weblogic\lib\jConnect-5_2\devclasses\jconn2d.jar;d: \weblogic\lib\weblogic510sp8boot.jar;d:\weblogic\jre1_2\jre\lib\rt.jar;d: \weblogic\jre1_2\jre\lib\i18n.jar;d:\weblogic\classes\boot;d: \weblogic\eval\cloudscape\lib\cloudscape.jar;d: \weblogic\lib\weblogic510sp8.jar;d:\weblogic\license;d:\weblogic\classes;d: \weblogic\myserver\serverclasses;d:\weblogic\lib\weblogicaux.jar;d: \JavaApplications\jars\hw\hw.jar;d: \JavaApplications\jars\common\TPCommon.jar;d: \JavaApplications\jars\utils\TPUtils.jar;d: \JavaApplications\jars\utils\TPData.jar;d: \JavaApplications\jars\utils\TPExceptions.jar;d: \JavaApplications\jars\oracle\classes12.zip;d: \JavaApplications\jars\utils\COMtoWebLogic.jar;d: \JavaApplications\jars\xml\xerces.jar;d: \JavaApplications\jars\xml\parser.jar;d: \JavaApplications\jars\xml\jaxp.jar;d: \JavaApplications\jars\xml\kbml-2.2.jar;d: \weblogic\lib\jConnect-5_2\devclasses\jconn2d.jar;d: \JavaApplications\JIntegra\lib\jintegra_reduced_logging.jar;d: \JavaApplications\JIntegra\lib\; at java.lang.Win32Process.create(Native Method) at java.lang.Win32Process.(Win32Process.java:64) at java.lang.Runtime.execInternal(Native Method) at java.lang.Runtime.exec(Runtime.java:272) at java.lang.Runtime.exec(Runtime.java:219) at weblogic.utils.Executable.exec(Executable.java, Compiled Code) at weblogic.utils.Executable.exec(Executable.java:107) at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java, Compiled Code) at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:245) at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled Code) at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:217) at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:164) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:101) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:907) at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:851) at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:252) at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:364) at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
RE: Template -struts-template and generated HTML / templating using PUSH model
Harcq, I just ran into this problem myself with WebSphere. The GetTag.java - the source behind the template:get tag that actually does the include calls pageContext and includes whatever content should go in. By default, the servlet engine should flush the buffer (that's what allows an include to go somewhere within your page). However, apparently some servers don't do that by default (WS 3.5.3 doesn't seem to). The solution is an easy one, but you'll need to recompile Struts. Under struts/src/share/org/apache/struts/taglib/template you will see a file called GetTag.java. Open that file. In the doStartTag() method you'll find the following code: pageContext.include(content.toString()); To fix your problem (hopefully, worked for me) add the following line above it: pageContext.getOut().flush(); So your end result will look like: pageContext.getOut().flush(); pageContext.include(content.toString()); By hardcoding the flush your problems should be solved. Recompiling struts is documented on the Struts installation web page. :) HTH, Chris Assenza -Original Message- From: Vincent Harcq [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 2:59 AM To: User Struts Subject: Template -struts-template and generated HTML / templating using PUSH model Hi, 1. I am beginning to look at Templating mechanism and so use the example struts-template using version pre-beta-2 (23/03/01). The result is a strange for me. Can somebody explain me this. On the first page, when I look at the generated code (look at the end of message), I got something where the side-bar.jsp and header.jsp is included BEFORE the tag; while from what I see in chapterTemplate.jsp, the should appear first. Is there a problem somewhere ? Does somebody is aware of that ? Is it my browser ? 2. I was also thinking about another mean of doing templating. The fact that I have two create each 2 files (introduction.jsp and introduction.html) is not really needed if you consider you have a little number of different templates to work with. Say you have only two templates (side-bar header content footer) (left-bar header content right-bar footer), it is too much for me to create each time the page that will use template:put. I have done that before I used Struts in a "request processor" by setting the value of a "content" field, forwarding to one of two pages template1.jsp and template2.jsp that uses jsp include tags. My plan was to do that in the findForward() method of ActionForwards and forward all the time to one of the 2 template pages that I have and setting the "content" value before. To speak "philosophically", but wishing to not re-open this debate, the PUSH method is for me more convenient that the "PULL" one for Page Templating Mechanism. But I do not want to "mix" Velocity and Struts only""" to solve this templating problem. Any ideas ? HTML generated: --- Topics Introduction Using Templates Optional Content ... and more ... . . . _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: html:errors, how to keep html out of messages?
In struts-example resource file errors.header has "" tag, and errors.footer has "" tag. This reason why each error message must to have these pair tags. Hope this help. Maya Phillip Rhodes wrote: > I am using the html:errors tag to display my messages, but I find that I > have to wrap each of my message key values with a for them to > display properly. > > Is there a way that as I iterator through my errors, that I could output > the error message with the tag? > > Thanks!
Re: Internationalised 'alt' text
Hi, this is an old email, but not resolved, at least for me. Maybe somebody can give me a hunt. I have tried both suggestions. Both are not working. Maybe I am doing something wrong. Thanks in advance. Maya Craig Tataryn wrote: > How about this: > > > > > > > Craig T. > > Peter Alfors wrote: > > > scratch that. You would need to have a bean that had access to the messages. > > > > Peter Alfors wrote: > > > > > I think that does what you want. > > > > > > > > > > > > > > > HTH, > > > Pete > > >
REPOSTED: html:image tag altKey - work or not?
Hi, I have a problem with this attribute - no visible value at the browser. Is this a bug or I am missing something? Thanks in advance. Maya
html:errors, how to keep html out of messages?
I am using the html:errors tag to display my messages, but I find that I have to wrap each of my message key values with a for them to display properly. Is there a way that as I iterator through my errors, that I could output the error message with the tag? Thanks!
RE: Struts and j2ee.jar
I think you have some other versions of servlet or XML classes in your j2ee.jar file. -Original Message- From: Ted Bergeron [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 27, 2001 3:31 PM To: Struts-User Subject: Struts and j2ee.jar I have a very simple app running on struts/tomcat 4.0 beta/Solaris x86. It works fine, until I place j2ee.jar in my WEB-INF/lib directory. Now I get: javax.servlet.ServletException: Missing resources attribute org.apache.struts.action.MESSAGE on every page. Remove the jar, restart tomcat, and it works. Ted Bergeron Senior Software Engineer WebSideStory, Inc. 10182 Telesis Court, Sixth Floor San Diego, CA 92121 P: 858.546.0040 F: 858.546.0480 E: [EMAIL PROTECTED]
Re: Initial security check
No. The init() method is called during servlet startup, not in the context of a request. No request means no response - there's no place for a JSP to go. I think you're pretty much stuck with logging an error and/or throwing an exception. -- Martin Cooper - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 28, 2001 8:55 AM Subject: Re: Initial security check > > > > Hi. Just one more question on this... > > If I find an error when I do the initial check in the controller (see history), > can I forward to an error page directly from the init() method? Is there a way > to do this elegantly? > > Thanks, > > Dave > > > > > > > "Craig R. McClanahan" <[EMAIL PROTECTED]> on 03/26/2001 > 01:04:33 PM > > Please respond to [EMAIL PROTECTED] > > To: [EMAIL PROTECTED] > cc:(bcc: David Hay/Lex/Lexmark) > Subject: Re: Initial security check > > > > > > On Mon, 26 Mar 2001 [EMAIL PROTECTED] wrote: > > > > > > > Craig, > > > > Thanks for the reply. Again, I'm not sure I explained too well. Whether I > > require users to login is determined *once* - when the application first > starts, > > depending on the underlying connected server. If they are required, whoever > > uses the app once it is up and running will have to log in. If not, they will > > have free access. So...what I am intending the controller init() method do, > is > > make this check *once*, and set a parameter that persists which indicates this > > fact. I can then check this parameter, rather than making calls to the > > connected server everytime. > > > > OK, the determination itself definitely makes sense to do at > init() time. You would want to store the result of this determination in > some sort of servlet context attribute, so that it was visible to the > controller servlet and to your pages (as an application scope bean). > > Two different approaches are feasible: > * Subclass ActionServlet and make the init() method a little smarter > * Write your own servlet that is also , and have it > set up this servlet context attribute. The example app does this > with it's "pseudo-database". > > > So...I think that this is correct usage for the controller - but please > correct > > me if I'm wrong! > > > > Dave > > > > Craig > > > > > > >
Re: Bug in tomcat or the JDK (testing it on 1.2.2)
ahh but if that is the case. how much data must be send to the client before it does noticed it? Because at this time the it is bufferd to a 8Kb buffer before it sends out but if the client can figure it out with say 1Kb then why wait for a buffer of 8KB to be read before sending it? I tracked it already down to the BufferedServletOutputStream.write(byte[],int,int) and the the reallyFlush() method can't be called twice. now i know why Johan - Original Message - From: "Szlapa, Michael" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 28, 2001 4:51 PM Subject: RE: Bug in tomcat or the JDK (testing it on 1.2.2) > That is not the bug. It's a feature ;-). > > When your browser realizes that it already has a copy of given file in > browser cache, it abruptly closes the connection in order not to waste time > and bandwidth. This causes exception on the server (tomcat) side of the > connection. It is plainly cosmetic nuisance. > > There is plenty of information on this on the web if you run the search on > "tomcat socket write error" > > Hope it helps, > > Michael Szlapa > [EMAIL PROTECTED] > > -Original Message- > From: Johan Compagner [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 28, 2001 9:49 AM > To: Struts > Subject: Bug in tomcat or the JDK (testing it on > 1.2.2) > > Hi, > > If i use Tomcat as a static (gifs) and dynamic (jsp) server, > that is mostly > used inside a debugging evironment or maybe if it is > specified that everything > in the webapp\app dir must be served by tomcat (still find > this a very bad idee), > then i noticed that i get socket exceptions on specifiek > files those files have > something in common they are the larger files in my app: > 31290 and 23281 bytes > > this is the error: > 2001-03-28 04:40:07 - Ctx( /financialtools ): IOException > in: R( /financialtools + /overlib.js + null) socket write error > (code=10053) > > Then i went testing in the source code of > org.apache.tomcat.request.FileHandler where it is thrown. > And after sometesting i found out that a picture can't be > larger then 16383 because if it is 16384 > then an exception will be thrown. I tested this with the > read in buffer: > byte[] buf = new byte[16383]; > > if that number is larger then 16383 i wil get a exception > when i write it. > so if i keept it 16383 then the first write to > out.write(buf, 0, read); will pass > but the next bloc will fail. And if i make it 16384, > out.write(buf, 0, read); will fail the first time! > > As far as i can see now it comes from the jdk it self: > > java.net.SocketException: socket write error (code=10053) > java.lang.Throwable(java.lang.String) > java.lang.Exception(java.lang.String) > java.io.IOException(java.lang.String) > java.net.SocketException(java.lang.String) > void java.net.SocketOutputStream.socketWrite(byte [], int, > int, java.io.FileDescriptor) <--- > void java.net.SocketOutputStream.write(byte [], int, int) > void > org.apache.tomcat.service.http.HttpResponseAdapter.doWrite(byte [], int, > int) > void > org.apache.tomcat.core.BufferedServletOutputStream.doWrite(byte [], int, > int) > void > org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush() > void > org.apache.tomcat.core.BufferedServletOutputStream.write(byte [], int, int) > void > org.apache.tomcat.request.FileHandler.doService(org.apache.tomcat.core.Reque > st, org.apache.tomcat.core.Response) > > > So is this a bug of Tomcat or the JDK it self? But can't > send more then 16K? that is a bit strange. > > I know this is not a tomcat list but when developing with > struts i came accross this and i don't want > to have another list that i have to monitor and i know there > are a few tomcat developers here. > > Johan > >
RE: please help!
Title: please help! Hi See-Yam, I am new to this list and don't know much myself, but I have seen a message like this one when an XML file did not conform to the DTD that was specified for it. Try looking at the DTD to see if something in the XML is not valid. If this is the example that you downloaded from Bluestone, I believe it didn't work for me either... hope this helps, Iraklis -Original Message-From: See Yam Lim [mailto:[EMAIL PROTECTED]]Sent: Wednesday, March 28, 2001 10:17 AMTo: Struts (E-mail)Subject: please help! Hey guys, I am using tomcat to deploy this internalization example and i got this error message. can anyone have any idea how to fix this problem? Thanks. org.apache.jasper.compiler.CompileException: D:\tomcat\webapps\hello-world\hello.jsp(2,0) Unable to open taglibrary /WEB-INF/struts-bean.tld : Parse Error in the tag library descriptor: Character conversion error: "Unconvertible UTF-8 character beginning with 0xb4" (line number may be too low). See-Yam
RE: problem using weblogic 6 and struts 1.0
Thanks a lot Laine. It works now. cheers, Amar.. -Original Message- From: Laine Donlan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: RE: problem using weblogic 6 and struts 1.0 It looks like you are ending you action tag in the first tag (i.e ) . Try removing that and it should be fine. Laine -Original Message- From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 12:09 PM To: '[EMAIL PROTECTED]' Subject: problem using weblogic 6 and struts 1.0 Running this example on weblogic 6 gives the following error. Can somebody point out the mistake i am making...Below is the action mapping where i am getting the error. The error is got at the tag. Parse Fatal Error at line 271 column 13: The element type "action-mappings" must be terminated by the matching end-tag " ". org.xml.sax.SAXParseException: The element type "action-mappings" must be terminated by the matching end-tag "". at weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java:10 08) at weblogic.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError( XMLDocumentScanner.java:634) at weblogic.apache.xerces.framework.XMLDocumentScanner.abortMarkup(XMLDocum entScanner.java:683) at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.di spatch(XMLDocumentScanner.java:1187) at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumen tScanner.java:380) at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:900) at weblogic.xml.jaxp.WebLogicParser.parse(WebLogicParser.java:67) at weblogic.xml.jaxp.RegistryParser.parse(RegistryParser.java:105) at javax.xml.parsers.SAXParser.parse(SAXParser.java:155) at javax.xml.parsers.SAXParser.parse(SAXParser.java:77) at org.apache.struts.digester.Digester.parse(Digester.java:716) at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:13 17) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl. java:687) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImp l.java:625) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl .java:573) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl .java:517) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServ letContext.java:940) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppSer vletContext.java:915) at weblogic.servlet.internal.HttpServer.loadWARContext(HttpServer.java:483) at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:394) at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74) at weblogic.j2ee.Application.addComponent(Application.java:116) at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:115) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Deploym entTarget.java:283) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Deploym entTarget.java:109) at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServer.j ava:76) at java.lang.reflect.Method.invoke(Native Method) at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBean Impl.java:559) at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.ja va:545) at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configuration MBeanImpl.java:285) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:431) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:172) at $Proxy30.addWebDeployment(Unknown Source) at weblogic.management.configuration.WebServerMBean_CachingStub.addWebDeplo yment(WebServerMBean_CachingStub.java :985) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Deploym entTarget.java:269) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Deploym entTarget.java:109) at java.lang.reflect.Method.invoke(Native Method) at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBean Impl.java:559) at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.ja va:545) at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configuration MBeanImpl.java:285) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:
RE: problem using weblogic 6 and struts 1.0
It looks like you are ending you action tag in the first tag (i.e ) . Try removing that and it should be fine. Laine -Original Message- From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 12:09 PM To: '[EMAIL PROTECTED]' Subject: problem using weblogic 6 and struts 1.0 Running this example on weblogic 6 gives the following error. Can somebody point out the mistake i am making...Below is the action mapping where i am getting the error. The error is got at the tag. Parse Fatal Error at line 271 column 13: The element type "action-mappings" must be terminated by the matching end-tag " ". org.xml.sax.SAXParseException: The element type "action-mappings" must be terminated by the matching end-tag "". at weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java:10 08) at weblogic.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError( XMLDocumentScanner.java:634) at weblogic.apache.xerces.framework.XMLDocumentScanner.abortMarkup(XMLDocum entScanner.java:683) at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.di spatch(XMLDocumentScanner.java:1187) at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumen tScanner.java:380) at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:900) at weblogic.xml.jaxp.WebLogicParser.parse(WebLogicParser.java:67) at weblogic.xml.jaxp.RegistryParser.parse(RegistryParser.java:105) at javax.xml.parsers.SAXParser.parse(SAXParser.java:155) at javax.xml.parsers.SAXParser.parse(SAXParser.java:77) at org.apache.struts.digester.Digester.parse(Digester.java:716) at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:13 17) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl. java:687) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImp l.java:625) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl .java:573) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl .java:517) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServ letContext.java:940) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppSer vletContext.java:915) at weblogic.servlet.internal.HttpServer.loadWARContext(HttpServer.java:483) at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:394) at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74) at weblogic.j2ee.Application.addComponent(Application.java:116) at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:115) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Deploym entTarget.java:283) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Deploym entTarget.java:109) at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServer.j ava:76) at java.lang.reflect.Method.invoke(Native Method) at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBean Impl.java:559) at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.ja va:545) at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configuration MBeanImpl.java:285) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:431) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:172) at $Proxy30.addWebDeployment(Unknown Source) at weblogic.management.configuration.WebServerMBean_CachingStub.addWebDeplo yment(WebServerMBean_CachingStub.java :985) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Deploym entTarget.java:269) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Deploym entTarget.java:109) at java.lang.reflect.Method.invoke(Native Method) at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBean Impl.java:559) at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.ja va:545) at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configuration MBeanImpl.java:285) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(C onfigurationMBeanImpl.java:405) at weblogic.management.inter
problem using weblogic 6 and struts 1.0
Running this example on weblogic 6 gives the following error. Can somebody point out the mistake i am making...Below is the action mapping where i am getting the error. The error is got at the tag. type="com.agilquest.onboard.struts.mobile.actions.SearchResultsViewReservationInfo_14Action" name="defaultForm" scope="session" input="/searchResultsViewReservationInfo_14.jsp"/> Parse Fatal Error at line 271 column 13: The element type "action-mappings" must be terminated by the matching end-tag "".org.xml.sax.SAXParseException: The element type "action-mappings" must be terminated by the matching end-tag "appings>". at weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1008) at weblogic.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:634) at weblogic.apache.xerces.framework.XMLDocumentScanner.abortMarkup(XMLDocumentScanner.java:683) at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1187) at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:380) at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:900) at weblogic.xml.jaxp.WebLogicParser.parse(WebLogicParser.java:67) at weblogic.xml.jaxp.RegistryParser.parse(RegistryParser.java:105) at javax.xml.parsers.SAXParser.parse(SAXParser.java:155) at javax.xml.parsers.SAXParser.parse(SAXParser.java:77) at org.apache.struts.digester.Digester.parse(Digester.java:716) at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1317) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:687) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:625) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:573) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:517) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:940) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:915) at weblogic.servlet.internal.HttpServer.loadWARContext(HttpServer.java:483) at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:394) at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74) at weblogic.j2ee.Application.addComponent(Application.java:116) at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:115) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:283) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:109) at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServer.java:76) at java.lang.reflect.Method.invoke(Native Method) at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:559) at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:545) at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:285) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:431) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:172) at $Proxy30.addWebDeployment(Unknown Source) at weblogic.management.configuration.WebServerMBean_CachingStub.addWebDeployment(WebServerMBean_CachingStub.java:985) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:269) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:109) at java.lang.reflect.Method.invoke(Native Method) at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:559) at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:545) at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:285) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555) at com.sun.management.jmx.MBeanServerImpl.invoke(MBea
Re: Initial security check
Hi. Just one more question on this... If I find an error when I do the initial check in the controller (see history), can I forward to an error page directly from the init() method? Is there a way to do this elegantly? Thanks, Dave "Craig R. McClanahan" <[EMAIL PROTECTED]> on 03/26/2001 01:04:33 PM Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: David Hay/Lex/Lexmark) Subject: Re: Initial security check On Mon, 26 Mar 2001 [EMAIL PROTECTED] wrote: > > > Craig, > > Thanks for the reply. Again, I'm not sure I explained too well. Whether I > require users to login is determined *once* - when the application first starts, > depending on the underlying connected server. If they are required, whoever > uses the app once it is up and running will have to log in. If not, they will > have free access. So...what I am intending the controller init() method do, is > make this check *once*, and set a parameter that persists which indicates this > fact. I can then check this parameter, rather than making calls to the > connected server everytime. > OK, the determination itself definitely makes sense to do at init() time. You would want to store the result of this determination in some sort of servlet context attribute, so that it was visible to the controller servlet and to your pages (as an application scope bean). Two different approaches are feasible: * Subclass ActionServlet and make the init() method a little smarter * Write your own servlet that is also , and have it set up this servlet context attribute. The example app does this with it's "pseudo-database". > So...I think that this is correct usage for the controller - but please correct > me if I'm wrong! > > Dave > Craig
Why no body allowed in jsp:getProperty or bean:write?
In order for the designer to be able to view a default row in a table (that I'm generating using iterate and jsp:getProperty--or I could use bean:write), I want to stick in a body value in there as a dummy value. Then the designer can open up the jsp page in the browser without it having to be served by a webserver. Currently, those two tags don't allow bodies. Why? There's no reason not to allow a body, just ignore it, and then you could have the flexibility of being able to view the jsp page directly (without server) and have dummy values in there to see how it looks. Is there a tag or property or something that will make this work? Thanks, -joel shellman
RE: Bug in tomcat or the JDK (testing it on 1.2.2)
To avoid thecosmetic ugliness, you can change the level of debug for the log in the tomcat server.xml file. The default setting is INFORMATION. This is a good setting for development but in production I would recommend putting it to ERROR. See the comments in Tomcat's server.xml file for more info. -Original Message- From: Szlapa, Michael [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 06:52 To: '[EMAIL PROTECTED]' Subject: RE: Bug in tomcat or the JDK (testing it on 1.2.2) That is not the bug. It's a feature ;-). When your browser realizes that it already has a copy of given file in browser cache, it abruptly closes the connection in order not to waste time and bandwidth. This causes exception on the server (tomcat) side of the connection. It is plainly cosmetic nuisance. There is plenty of information on this on the web if you run the search on "tomcat socket write error" Hope it helps, Michael Szlapa [EMAIL PROTECTED] -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 9:49 AM To: Struts Subject:Bug in tomcat or the JDK (testing it on 1.2.2) Hi, If i use Tomcat as a static (gifs) and dynamic (jsp) server, that is mostly used inside a debugging evironment or maybe if it is specified that everything in the webapp\app dir must be served by tomcat (still find this a very bad idee), then i noticed that i get socket exceptions on specifiek files those files have something in common they are the larger files in my app: 31290 and 23281 bytes this is the error: 2001-03-28 04:40:07 - Ctx( /financialtools ): IOException in: R( /financialtools + /overlib.js + null) socket write error (code=10053) Then i went testing in the source code of org.apache.tomcat.request.FileHandler where it is thrown. And after sometesting i found out that a picture can't be larger then 16383 because if it is 16384 then an exception will be thrown. I tested this with the read in buffer: byte[] buf = new byte[16383]; if that number is larger then 16383 i wil get a exception when i write it. so if i keept it 16383 then the first write to out.write(buf, 0, read); will pass but the next bloc will fail. And if i make it 16384, out.write(buf, 0, read); will fail the first time! As far as i can see now it comes from the jdk it self: java.net.SocketException: socket write error (code=10053) java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) java.io.IOException(java.lang.String) java.net.SocketException(java.lang.String) void java.net.SocketOutputStream.socketWrite(byte [], int, int, java.io.FileDescriptor) <--- void java.net.SocketOutputStream.write(byte [], int, int) void org.apache.tomcat.service.http.HttpResponseAdapter.doWrite(byte [], int, int) void org.apache.tomcat.core.BufferedServletOutputStream.doWrite(byte [], int, int) void org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush() void org.apache.tomcat.core.BufferedServletOutputStream.write(byte [], int, int) void org.apache.tomcat.request.FileHandler.doService(org.apache.tomcat.core.Reque st, org.apache.tomcat.core.Response) So is this a bug of Tomcat or the JDK it self? But can't send more then 16K? that is a bit strange. I know this is not a tomcat list but when developing with struts i came accross this and i don't want to have another list that i have to monitor and i know there are a few tomcat developers here. Johan
please help!
Title: please help! Hey guys, I am using tomcat to deploy this internalization example and i got this error message. can anyone have any idea how to fix this problem? Thanks. org.apache.jasper.compiler.CompileException: D:\tomcat\webapps\hello-world\hello.jsp(2,0) Unable to open taglibrary /WEB-INF/struts-bean.tld : Parse Error in the tag library descriptor: Character conversion error: "Unconvertible UTF-8 character beginning with 0xb4" (line number may be too low). See-Yam
Struts in WebSphere - VICTORY !!!!!!! - Addendum
If changing the DTD's to SYSTEM, do so ONLY AFTER using the Convert a War util. Ant doesn't seem to like it the other way! :) Chris Assenza -Original Message- From: Assenza, Chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 10:37 AM To: '[EMAIL PROTECTED]' Subject: RE: The Continuing Misadventures of Struts in WebSphere - VICTORY !!! After quite a bit of effort, I have finally gotten the Struts example to work flawlessly in WebSphere 3.5.3. What's funny is that I was reading your post Richard and was thinking to myself: "Gee, I've done ALL of this EXACTLY -- in fact I'm even on the same OS, just different drive letters, WHAT could be wrong??" Then it hit me, looking through your steps below I found the one thing that was different that had completely slipped through - jaxp 1.0.1. I was using jaxp 1.1.1!! Crimson is a separate jar now, that includes the stuff from parser.jar, but it apparently does something different then 1.0.1 and it was just screwing everything up! I downloaded 1.0.1 and got significantly further then I ever have, but ran into another problem. WebSphere reported that the public identifiers for the DTD's were malformed URLs. Luckily, I saw on another mailing list an issue with WebSphere & Struts not liking PUBLIC DTD refs, so I changed them to SYSTEM and away it flew - flawlessly. For those people who run into these issues (and because I have to document it for work anyway - here is Richard's list again revised with more detail on some of the bugs I encountered. (BTW, adding web to the classpath did not help me, I had to move it to the servlets directory). Server: Windows 2000 Server with WebSphere 3.5.3 Advanced 1. Start up the adminserver. 2. Start up Admin Console. 3. Use the Convert War file task to convert the struts-example.war from the struts-b1 distrib as-is. 4. Convert to the default_server, default servlet engine and standard install directory (c:\websphere\appserver\hosts\default_host). 5. Create a WEB-INF directory in the servlets dir and copy struts-config.xml, database.xml AND web.xml into it (Keep WEB-INF with all the TLD's under web - both WEB-INF directories must be present). 6. Copy jaxp 1.0.1's (NOT 1.1.1's) jaxp.jar and parser.jar to the servlets directory of the strut-example webapp. 7. In the servlets directory, open struts.jar with WinZip. Extract the three DTD's (struts-config_1_0.dtd, web-app_2_2.dtd and web-app_2_3.dtd) into the servlets directory making sure you use folder names (so the files extract to servlets/org/apache/struts/resources). 8. Click on struts-example in the Admin Console under Default Server/Default Servlet Engine and click the advanced tab on the right hand side of the screen. 9. Down where it says Default Error Page, enter /ErrorReporter and then click Apply. 10. Start the Default Server via the Admin Console. You should see a whole bunch of ActionServlet messages in the default_host_stdout.log file with no exceptions. 11. Via a browser accessed the app using http://localhost/struts-example/index.jsp. 12. If it returns "Application not Available" then go back to the Admin Console, right-click on struts-example and select Restart WebApp. 13. Once it reports success, go back to the URL above and try again - it should work flawlessly. For whatever reason, some installations do not like XML files that reference PUBLIC DTD's - if in looking at the default_host_stdout.log file you see errors about invalid public URL references during DTD registrations, or if your pages say "cannot find //logon or //saveRegistration (ie. action mappings) then do the following: 1. Stop Default Server 2. Go to servlets\WEB-INF\ and edit web.xml and struts_config.xml. 3. In the DOCTYPE declaration, change the word PUBLIC to SYSTEM and completely remove the line that reads "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" from web.xml and remove "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" from struts-config.xml. 4. Save these changes and go back to step 10 above. Just as a troubleshooting guide - If you are getting errors like "Cannot find ActionMappings, etc..." or "Cannot find key org.apache.struts.MESSAGE" then your application is most likely still bombing on the struts-config issue that Richard discovered. The above steps SHOULD correct that leaving nothing out. If you are getting 404 errors about //logon or something not found, then you are still having XML config troubles and it is not initializing the Action servlet properly. Follow the steps above in regards to DTD's and it should work. As a final thought, I obviously haven't gotten to test too much but I don't believe that there are ANY coding changes that need to be made to the actual struts source. Everything about getting it to work in WebSphere has been a WebSphere configuration issue thus far (and I don't think I'll be having any more). Thanks for your help Richard and I hope others benefit from this as well! :)
Pooling with Oracle database
Hello, How to encode one pool of connections for whole application ? Should I encode this in some main servlet and then receive connection from this servlet ? In struts-config.xml I have a section: description="Trial access to database" driverClass="oracle.jdbc.driver.OracleDriver" maxCount="4" minCount="2" password="123" url="jdbc:oracle:thin:@ado:1521:123" user="123" /> tnx
RE: The Continuing Misadventures of Struts in WebSphere - VICTORY!!!!!!!
After quite a bit of effort, I have finally gotten the Struts example to work flawlessly in WebSphere 3.5.3. What's funny is that I was reading your post Richard and was thinking to myself: "Gee, I've done ALL of this EXACTLY -- in fact I'm even on the same OS, just different drive letters, WHAT could be wrong??" Then it hit me, looking through your steps below I found the one thing that was different that had completely slipped through - jaxp 1.0.1. I was using jaxp 1.1.1!! Crimson is a separate jar now, that includes the stuff from parser.jar, but it apparently does something different then 1.0.1 and it was just screwing everything up! I downloaded 1.0.1 and got significantly further then I ever have, but ran into another problem. WebSphere reported that the public identifiers for the DTD's were malformed URLs. Luckily, I saw on another mailing list an issue with WebSphere & Struts not liking PUBLIC DTD refs, so I changed them to SYSTEM and away it flew - flawlessly. For those people who run into these issues (and because I have to document it for work anyway - here is Richard's list again revised with more detail on some of the bugs I encountered. (BTW, adding web to the classpath did not help me, I had to move it to the servlets directory). Server: Windows 2000 Server with WebSphere 3.5.3 Advanced 1. Start up the adminserver. 2. Start up Admin Console. 3. Use the Convert War file task to convert the struts-example.war from the struts-b1 distrib as-is. 4. Convert to the default_server, default servlet engine and standard install directory (c:\websphere\appserver\hosts\default_host). 5. Create a WEB-INF directory in the servlets dir and copy struts-config.xml, database.xml AND web.xml into it (Keep WEB-INF with all the TLD's under web - both WEB-INF directories must be present). 6. Copy jaxp 1.0.1's (NOT 1.1.1's) jaxp.jar and parser.jar to the servlets directory of the strut-example webapp. 7. In the servlets directory, open struts.jar with WinZip. Extract the three DTD's (struts-config_1_0.dtd, web-app_2_2.dtd and web-app_2_3.dtd) into the servlets directory making sure you use folder names (so the files extract to servlets/org/apache/struts/resources). 8. Click on struts-example in the Admin Console under Default Server/Default Servlet Engine and click the advanced tab on the right hand side of the screen. 9. Down where it says Default Error Page, enter /ErrorReporter and then click Apply. 10. Start the Default Server via the Admin Console. You should see a whole bunch of ActionServlet messages in the default_host_stdout.log file with no exceptions. 11. Via a browser accessed the app using http://localhost/struts-example/index.jsp. 12. If it returns "Application not Available" then go back to the Admin Console, right-click on struts-example and select Restart WebApp. 13. Once it reports success, go back to the URL above and try again - it should work flawlessly. For whatever reason, some installations do not like XML files that reference PUBLIC DTD's - if in looking at the default_host_stdout.log file you see errors about invalid public URL references during DTD registrations, or if your pages say "cannot find //logon or //saveRegistration (ie. action mappings) then do the following: 1. Stop Default Server 2. Go to servlets\WEB-INF\ and edit web.xml and struts_config.xml. 3. In the DOCTYPE declaration, change the word PUBLIC to SYSTEM and completely remove the line that reads "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" from web.xml and remove "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" from struts-config.xml. 4. Save these changes and go back to step 10 above. Just as a troubleshooting guide - If you are getting errors like "Cannot find ActionMappings, etc..." or "Cannot find key org.apache.struts.MESSAGE" then your application is most likely still bombing on the struts-config issue that Richard discovered. The above steps SHOULD correct that leaving nothing out. If you are getting 404 errors about //logon or something not found, then you are still having XML config troubles and it is not initializing the Action servlet properly. Follow the steps above in regards to DTD's and it should work. As a final thought, I obviously haven't gotten to test too much but I don't believe that there are ANY coding changes that need to be made to the actual struts source. Everything about getting it to work in WebSphere has been a WebSphere configuration issue thus far (and I don't think I'll be having any more). Thanks for your help Richard and I hope others benefit from this as well! :) Chris Assenza
Iterate tag problem- can't find properties in the Collection elements
Well it is finally time for me to use the iterate tag. Unfortunately I ignored the millions of past posts about the iterate tag- so if this question has already been answered I apologize in advance :) However, after searching through some previous posts and the documentation I can't understand why this does not work. I am probably using the simplest form of the iterate tag: Is this working? recentRequests is a Collection (an ArrayList to be exact) in session scope. Each element in the Collection is a simple javabean with the appropriate setters and getters (requestName, requestDate, etc...) The strange thing is that the iterate part is working- verified by the output of the last in the above example (if the Collection contains 2 elements, then it iterates twice but all I get is "is this working"). The bean:write tags produce no output. I have verified the content of the Collection using plain JSP, which works as intended: <% java.util.Iterator it = ((Collection)recentRequests).iterator(); while ( it.hasNext() ) { com.bipi.plims.model.FermSummaryBean bean = (com.bipi.plims.model.FermSummaryBean)it.next(); out.write(bean.getRequestName()); out.write(bean.getRequestDate().toString()); out.write(bean.getRequestBy()); out.write(bean.getStatus()); out.write(""); } %> suggestions??? Thanks, Bob
Re: Removing ActionForm's from context
Right, but notice the exact wording--it says "remove it only if the scope is set to "request""--but that's the main case where you wouldn't need to remove it. page and session removal would make sense, but request removal only makes sense in the situation you describe which I would think wouldn't happen all that often. -joel Jean-Noel Ribette wrote: > > I don't quite understand the the below quote from the example tour. The > > paragraph doesn't make sense. Anything in request scope will be removed > > after the request is over automatically. So there's no need to remove it > > just so if the user comes back later to the same page--it would have > > been long gone before then. Right? What is it talking about? > > > > Right, using request scope should avoid population of a form from old values. But >request scope is not always used. > Moreover if you forward the request to another Action or a jsp, you might not want >them to have access to the form, > which can eventually contain sensible data like a password. > > This is my feeling about it, > > Jean-Noel > > > Thanks! > > > > Before returning from a successful login, LogonAction also disposes of > > the LogonForm bean. This way, if the > > user returns to the index.jsp form later, it will be a clean form > > without the (old) login already entered. Note > > that LogonAction first checks to see if the scope has been set to > > "request", and then removes the bean from > > the request context, or otherwise from the default session context. > > > > The Struts best practice is to use request scope for > > single-page forms that contain all of your > > relevant properties, because there is no need to maintain > > such form beans across requests. > > > > Note that the example removes the LogonForm bean > > regardless of scope. This is for backward > > compatibility with earlier configurations. In your > > application, you should follow the advice of > > the configuration, and remove it only if the scope is set > > to "request". This way, the behavior > > can be changed just by editing struts-config.xml and > > reloading the application. " > > > > -- > > Joel Shellman > > KnOcean Interactive Corporation > > http://www.knocean.com/ > >
Re: Removing ActionForm's from context
- Original Message - From: Joel Shellman <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 28, 2001 4:22 PM Subject: Removing ActionForm's from context > I don't quite understand the the below quote from the example tour. The > paragraph doesn't make sense. Anything in request scope will be removed > after the request is over automatically. So there's no need to remove it > just so if the user comes back later to the same page--it would have > been long gone before then. Right? What is it talking about? > Right, using request scope should avoid population of a form from old values. But request scope is not always used. Moreover if you forward the request to another Action or a jsp, you might not want them to have access to the form, which can eventually contain sensible data like a password. This is my feeling about it, Jean-Noel > Thanks! > > Before returning from a successful login, LogonAction also disposes of > the LogonForm bean. This way, if the > user returns to the index.jsp form later, it will be a clean form > without the (old) login already entered. Note > that LogonAction first checks to see if the scope has been set to > "request", and then removes the bean from > the request context, or otherwise from the default session context. > > The Struts best practice is to use request scope for > single-page forms that contain all of your > relevant properties, because there is no need to maintain > such form beans across requests. > > Note that the example removes the LogonForm bean > regardless of scope. This is for backward > compatibility with earlier configurations. In your > application, you should follow the advice of > the configuration, and remove it only if the scope is set > to "request". This way, the behavior > can be changed just by editing struts-config.xml and > reloading the application. " > > -- > Joel Shellman > KnOcean Interactive Corporation > http://www.knocean.com/ >
Re: JavaScript in Struts
You can either add the individual functions to your JSP page using the
RE: Bug in tomcat or the JDK (testing it on 1.2.2)
That is not the bug. It's a feature ;-). When your browser realizes that it already has a copy of given file in browser cache, it abruptly closes the connection in order not to waste time and bandwidth. This causes exception on the server (tomcat) side of the connection. It is plainly cosmetic nuisance. There is plenty of information on this on the web if you run the search on "tomcat socket write error" Hope it helps, Michael Szlapa [EMAIL PROTECTED] -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 9:49 AM To: Struts Subject:Bug in tomcat or the JDK (testing it on 1.2.2) Hi, If i use Tomcat as a static (gifs) and dynamic (jsp) server, that is mostly used inside a debugging evironment or maybe if it is specified that everything in the webapp\app dir must be served by tomcat (still find this a very bad idee), then i noticed that i get socket exceptions on specifiek files those files have something in common they are the larger files in my app: 31290 and 23281 bytes this is the error: 2001-03-28 04:40:07 - Ctx( /financialtools ): IOException in: R( /financialtools + /overlib.js + null) socket write error (code=10053) Then i went testing in the source code of org.apache.tomcat.request.FileHandler where it is thrown. And after sometesting i found out that a picture can't be larger then 16383 because if it is 16384 then an exception will be thrown. I tested this with the read in buffer: byte[] buf = new byte[16383]; if that number is larger then 16383 i wil get a exception when i write it. so if i keept it 16383 then the first write to out.write(buf, 0, read); will pass but the next bloc will fail. And if i make it 16384, out.write(buf, 0, read); will fail the first time! As far as i can see now it comes from the jdk it self: java.net.SocketException: socket write error (code=10053) java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) java.io.IOException(java.lang.String) java.net.SocketException(java.lang.String) void java.net.SocketOutputStream.socketWrite(byte [], int, int, java.io.FileDescriptor) <--- void java.net.SocketOutputStream.write(byte [], int, int) void org.apache.tomcat.service.http.HttpResponseAdapter.doWrite(byte [], int, int) void org.apache.tomcat.core.BufferedServletOutputStream.doWrite(byte [], int, int) void org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush() void org.apache.tomcat.core.BufferedServletOutputStream.write(byte [], int, int) void org.apache.tomcat.request.FileHandler.doService(org.apache.tomcat.core.Reque st, org.apache.tomcat.core.Response) So is this a bug of Tomcat or the JDK it self? But can't send more then 16K? that is a bit strange. I know this is not a tomcat list but when developing with struts i came accross this and i don't want to have another list that i have to monitor and i know there are a few tomcat developers here. Johan
RE: Bug in tomcat or the JDK (testing it on 1.2.2)
I've been seeing this under JDK 1.3 also. I also get a similar error when my stylesheet loads. Wayne [EMAIL PROTECTED] -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 8:49 AM To: Struts Subject: Bug in tomcat or the JDK (testing it on 1.2.2) Hi, If i use Tomcat as a static (gifs) and dynamic (jsp) server, that is mostly used inside a debugging evironment or maybe if it is specified that everything in the webapp\app dir must be served by tomcat (still find this a very bad idee), then i noticed that i get socket exceptions on specifiek files those files have something in common they are the larger files in my app: 31290 and 23281 bytes this is the error: 2001-03-28 04:40:07 - Ctx( /financialtools ): IOException in: R( /financialtools + /overlib.js + null) socket write error (code=10053) Then i went testing in the source code of org.apache.tomcat.request.FileHandler where it is thrown. And after sometesting i found out that a picture can't be larger then 16383 because if it is 16384 then an exception will be thrown. I tested this with the read in buffer: byte[] buf = new byte[16383]; if that number is larger then 16383 i wil get a exception when i write it. so if i keept it 16383 then the first write to out.write(buf, 0, read); will pass but the next bloc will fail. And if i make it 16384, out.write(buf, 0, read); will fail the first time! As far as i can see now it comes from the jdk it self: java.net.SocketException: socket write error (code=10053) java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) java.io.IOException(java.lang.String) java.net.SocketException(java.lang.String) void java.net.SocketOutputStream.socketWrite(byte [], int, int, java.io.FileDescriptor) <--- void java.net.SocketOutputStream.write(byte [], int, int) void org.apache.tomcat.service.http.HttpResponseAdapter.doWrite(byte [], int, int) void org.apache.tomcat.core.BufferedServletOutputStream.doWrite(byte [], int, int) void org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush() void org.apache.tomcat.core.BufferedServletOutputStream.write(byte [], int, int) void org.apache.tomcat.request.FileHandler.doService(org.apache.tomcat.core.Reque st, org.apache.tomcat.core.Response) So is this a bug of Tomcat or the JDK it self? But can't send more then 16K? that is a bit strange. I know this is not a tomcat list but when developing with struts i came accross this and i don't want to have another list that i have to monitor and i know there are a few tomcat developers here. Johan
Bug in tomcat or the JDK (testing it on 1.2.2)
Hi, If i use Tomcat as a static (gifs) and dynamic (jsp) server, that is mostly used inside a debugging evironment or maybe if it is specified that everything in the webapp\app dir must be served by tomcat (still find this a very bad idee), then i noticed that i get socket exceptions on specifiek files those files have something in common they are the larger files in my app: 31290 and 23281 bytes this is the error: 2001-03-28 04:40:07 - Ctx( /financialtools ): IOException in: R( /financialtools + /overlib.js + null) socket write error (code=10053) Then i went testing in the source code of org.apache.tomcat.request.FileHandler where it is thrown. And after sometesting i found out that a picture can't be larger then 16383 because if it is 16384 then an exception will be thrown. I tested this with the read in buffer: byte[] buf = new byte[16383]; if that number is larger then 16383 i wil get a exception when i write it. so if i keept it 16383 then the first write to out.write(buf, 0, read); will pass but the next bloc will fail. And if i make it 16384, out.write(buf, 0, read); will fail the first time! As far as i can see now it comes from the jdk it self: java.net.SocketException: socket write error (code=10053) java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) java.io.IOException(java.lang.String) java.net.SocketException(java.lang.String) void java.net.SocketOutputStream.socketWrite(byte [], int, int, java.io.FileDescriptor) <--- void java.net.SocketOutputStream.write(byte [], int, int) void org.apache.tomcat.service.http.HttpResponseAdapter.doWrite(byte [], int, int) void org.apache.tomcat.core.BufferedServletOutputStream.doWrite(byte [], int, int) void org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush() void org.apache.tomcat.core.BufferedServletOutputStream.write(byte [], int, int) void org.apache.tomcat.request.FileHandler.doService(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response) So is this a bug of Tomcat or the JDK it self? But can't send more then 16K? that is a bit strange. I know this is not a tomcat list but when developing with struts i came accross this and i don't want to have another list that i have to monitor and i know there are a few tomcat developers here. Johan
RE: Actions and Session Beans
There is a good description of what you want to do in an IBM Redbook titled "Design and Implement Servlets, JSPs, and EJBs for IBM WebSphere Application Server" (SG24-5754-00, August 2000). You can probably download the PDF from IBM's Redbooks web site. The techniques aren't specific to WebSphere. There is a patterns for a Targetable Commands, which it sounds like you're talking about. There is also a good description with code samples of using the facade pattern with session beans and the command pattern, which also sounds like what you want to do. It doesn't have anything about Struts, but maybe by looking at it you'll get some ideas. It's only 178 pages. Bill Hines Hershey Foods -Original Message- From: G.L. Grobe [mailto:[EMAIL PROTECTED]] Sent: Saturday, March 24, 2001 3:42 AM To: [EMAIL PROTECTED] Subject: Actions and Session Beans I've finally got struts taglibs and a few Actions working in my jsp pages, but I'd like to be able to populate some EJB's with the model data from the ActionForms. I'm not sure how to do this. I've got a session bean which operates on an entity bean which I will then send to another machines java app, but I'm not sure how to implement the session bean in my Action. Anyone know of examples or where I may find some refs on doing this?
Re: Template -struts-template and generated HTML / templating using PUSH model
Hi, Christophe, I understand that you prefer to talk in French. But we cannot read your email. If you would like to talk only with Cedric, you can send email only to him, not all struts users. Thanks and sorry for any interruption. Maya Christophe Vigny wrote: > J'espere, que cela prendra en compte l'internationnalisation. Les fichiers de > resources, ne permettent pas de gerer des pages stylisées. > > Ce qui m'interesserait, dans un systeme de templates, ce sont des feuilles de style > (pas xsl) qui s'appliqueraient sur des beans, et qui permettrait au graphiste de > définir globalement comment s'affiche l'objet, puis de l'utiliser via des tags. > > a+ > > Cedric Dumoulin a écrit : > > > Hi Vincent, > > > > Have a look to Components proposal. Components proposal can be seen as > > "extended templates". With Components you can define your template's > > contents/attributes in a separate file, and insert content by using its name. A > > content, named a component, can also inherit from other definitions. Components > > proposal also contains other features. > > See (main site) http://www.lifl.fr/~dumoulin/components > > (mirror) http://www.geocities.com/cedricdumoulin/components/ > > > > I am currently working on the possibility to define or modify the > > template/component inside the action or inside the jsp. This will be available > > soon (see a previous mail 'Re: PROPOSAL: Template Screens'). > > Furthermore, useful Components features will be progressively introduce in > > Struts version 1.1 > > > > For your first question, see intermixed. > > > > Cedric > > > > Vincent Harcq wrote: > > > > > Hi, > > > > > > 1. I am beginning to look at Templating mechanism and so use the example > > > struts-template using version pre-beta-2 (23/03/01). > > > The result is a strange for me. Can somebody explain me this. > > > On the first page, when I look at the generated code (look at the end of > > > message), I got something where the side-bar.jsp and header.jsp is included > > > BEFORE the tag; while from what I see in chapterTemplate.jsp, the > > > should appear first. > > > Is there a problem somewhere ? Does somebody is aware of that ? Is it my > > > browser ? > > > > > > > What jsp server do you use ? This happens because your server doesn't flush > > included page. > > You can try to use the components library instead of template one, it is fully > > compatible. > > > > > > > > 2. I was also thinking about another mean of doing templating. The fact > > > that I have two create each 2 files (introduction.jsp and introduction.html) > > > is not really needed if you consider you have a little number of different > > > templates to work with. > > > Say you have only two templates (side-bar header content footer) (left-bar > > > header content right-bar footer), it is too much for me to create each time > > > the page that will use template:put. > > > I have done that before I used Struts in a "request processor" by setting > > > the value of a "content" field, forwarding to one of two pages template1.jsp > > > and template2.jsp that uses jsp include tags. > > > My plan was to do that in the findForward() method of ActionForwards and > > > forward all the time to one of the 2 template pages that I have and setting > > > the "content" value before. > > > To speak "philosophically", but wishing to not re-open this debate, the PUSH > > > method is for me more convenient that the "PULL" one for Page Templating > > > Mechanism. But I do not want to "mix" Velocity and Struts only""" to > > > solve this templating problem. > > > > > > > > > > > Any ideas ? > > > > > > HTML generated: > > > --- > > > > > > Topics > > > > > > > > > Introduction > > > > > > > > > Using Templates > > > > > > > > > Optional Content > > > > > > ... and more ... > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > . . . > > > > > > _ > > > Do You Yahoo!? > > > Get your free @yahoo.com address at http://mail.yahoo.com
Removing ActionForm's from context
I don't quite understand the the below quote from the example tour. The paragraph doesn't make sense. Anything in request scope will be removed after the request is over automatically. So there's no need to remove it just so if the user comes back later to the same page--it would have been long gone before then. Right? What is it talking about? Thanks! Before returning from a successful login, LogonAction also disposes of the LogonForm bean. This way, if the user returns to the index.jsp form later, it will be a clean form without the (old) login already entered. Note that LogonAction first checks to see if the scope has been set to "request", and then removes the bean from the request context, or otherwise from the default session context. The Struts best practice is to use request scope for single-page forms that contain all of your relevant properties, because there is no need to maintain such form beans across requests. Note that the example removes the LogonForm bean regardless of scope. This is for backward compatibility with earlier configurations. In your application, you should follow the advice of the configuration, and remove it only if the scope is set to "request". This way, the behavior can be changed just by editing struts-config.xml and reloading the application. " -- Joel Shellman KnOcean Interactive Corporation http://www.knocean.com/
Re: Connection to Oracle 8i datasource
I'm kind of new to struts, but I have this working. Your data source configuration in struts-config.xml looks fine. You can check your logs to make sure no errors are thrown when you start your server (I use Tomcat 3.2.1). In your code you set up datasource, as below: javax.sql.DataSource dataSource = null; dataSource = servlet.findDataSource(null); I do it, like so: DataSource dataSource = (DataSource) servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY); Hope this helps, Donnie Hall |+---> || suresh@tufan.| || com | || | || 03/27/2001 | || 05:15 AM | || Please | || respond to | || struts-user | || | |+---> >| || | To: [EMAIL PROTECTED], [EMAIL PROTECTED]| | cc: (bcc: Donnie Hall/Enron Communications) | | Subject: Connection to Oracle 8i datasource | >| Hello, We at Tufan Infotech are evaluating Struts for using in our web application development. I am not able to connect to a Oracle 8i database and retrieve or update data. The datasource configuration in struts-config.xml is given below. The code snippet which tried to connect is given below Connection con = null; PreparedStatement ps = null; ResultSet rst = null; javax.sql.DataSource dataSource = null; String str = "insert into metadata values (?,?,?,?,?)"; String type=((MetadataForm)form).getType(); String code=((MetadataForm)form).getCode(); String description=((MetadataForm)form).getDescription(); String sequence=((MetadataForm)form).getSequence(); String isDefault=((MetadataForm)form).getIsDefault(); ActionErrors errors = new ActionErrors(); try { dataSource = servlet.findDataSource(null); con = dataSource.getConnection(); ps = con.prepareStatement(str); ps.setString(1,type); ps.setString(2,code); ps.setString(3,description); ps.setString(4,sequence); ps.setString(5,isDefault); ps.executeUpdate(); } catch(Exception e) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError ("error.database.missing")); } finally { try { con.close(); } catch(Exception e) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError ("error.database.missing")); } } The above code is not updating the database. It thows an exception and shows the message in 'errors'. One of the statements below seems to be failing and gives a nullPointerException. Would appreciate some inputs to solve the problem. Also would appreciate code snippets used to connect to datasources (example Oracle). Best regards Suresh
RE: Installing Struts using WebLogic 6.0
I deploy my struts app in weblogic 6 as a .war file. You need to copy the war file into the C:\bea\wlserver6.0\config\mydomain\applications directory Weblogic will automatically detect the war file and load it. cheers, Amar.. -Original Message- From: Steven Leija [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 12:02 AM To: '[EMAIL PROTECTED]' Subject: Installing Struts using WebLogic 6.0 Hello All, I'm new to Struts and trying to get Struts installed, but running into problems setting up my xml files. Does anyone have instructions for installing struts using weblogic at my server? I'm having trouble understanding how to modify the web.xml file to include the necessary xml elements. If anyone has any help or tips for setting up struts, please help! Thanks for any help! Steven
RE: Installing Struts using WebLogic 6.0
If you are using WebLogic 5.1 (Service Pack 8)---> http://jakarta.apache.org/struts/installation-wls.html If you are using WebLogic 6+ ---> It appears you can just follow the Installation guide... (http://jakarta.apache.org/struts/installation.html) -brian -Original Message- From: Steven Leija [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 27, 2001 11:02 PM To: '[EMAIL PROTECTED]' Subject: Installing Struts using WebLogic 6.0 Hello All, I'm new to Struts and trying to get Struts installed, but running into problems setting up my xml files. Does anyone have instructions for installing struts using weblogic at my server? I'm having trouble understanding how to modify the web.xml file to include the necessary xml elements. If anyone has any help or tips for setting up struts, please help! Thanks for any help! Steven
Newbie datasource Q
JOEL VOGT writes: > Hopefully this is an easy question for somebody. > In my struts-config I have the datasource > > autoCommit="false" > description="Access data source config" > driverClass="sun.jdbc.odbc.JdbcOdbcDriver" > maxCount="4" > minCount="2" > password="mypassword" > url="jdbc:odbc:Rec97" > user="myusername" > /> > > > later on in a servlet I have I think this is the problem. AFAIK, the struts DataSource is only accessible from within an Action class (not a Servlet class). -- Nick > javax.sql.DataSource dataSource = servlet.findDataSource(null); > con = dataSource.getConnection(); > > When I try to use this however, I get an java.sql exception : > 'no data found' > > Anyone know how to fix this, do this proper? It works fine if I hard > code in the database details. > > Thanks, > Joel. >
JavaScript in Struts
Title: JavaScript in Struts How do I perform javascript validation in struts pages ??
Connection to Oracle 8i datasource
Hello, We at Tufan Infotech are evaluating Struts for using in our web application development. I am not able to connect to a Oracle 8i database and retrieve or update data. The datasource configuration in struts-config.xml is given below. The code snippet which tried to connect is given below Connection con = null; PreparedStatement ps = null; ResultSet rst = null; javax.sql.DataSource dataSource = null; String str = "insert into metadata values (?,?,?,?,?)"; String type=((MetadataForm)form).getType(); String code=((MetadataForm)form).getCode(); String description=((MetadataForm)form).getDescription(); String sequence=((MetadataForm)form).getSequence(); String isDefault=((MetadataForm)form).getIsDefault(); ActionErrors errors = new ActionErrors(); try { dataSource = servlet.findDataSource(null); con = dataSource.getConnection(); ps = con.prepareStatement(str); ps.setString(1,type); ps.setString(2,code); ps.setString(3,description); ps.setString(4,sequence); ps.setString(5,isDefault); ps.executeUpdate(); } catch(Exception e) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError ("error.database.missing")); } finally { try { con.close(); } catch(Exception e) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError ("error.database.missing")); } } The above code is not updating the database. It thows an exception and shows the message in 'errors'. One of the statements below seems to be failing and gives a nullPointerException. Would appreciate some inputs to solve the problem. Also would appreciate code snippets used to connect to datasources (example Oracle). Best regards Suresh
Can I nest tag in tag?
Hi struts-user, Can I nest tag in tag ? Because I want to setup some query parameter reserved values in resources. Thx :=) Best regards, JeanX pacificnet.com(GZ)
RE: Template -struts-template and generated HTML / templating using PUSH model
Merci. I will have a look at it. For my problem, I use . . . heuh, Tomcat 3.2.1 :( I just tried with Catalina 4.0b1 and . . . wow, it works fine :) Does I need a special parameter in server.xml, something else ??? Vincent -Message d'origine- De : Cedric Dumoulin [mailto:[EMAIL PROTECTED]] Envoye : mercredi 28 mars 2001 11:06 A : [EMAIL PROTECTED] Objet : Re: Template -struts-template and generated HTML / templating using PUSH model Hi Vincent, Have a look to Components proposal. Components proposal can be seen as "extended templates". With Components you can define your template's contents/attributes in a separate file, and insert content by using its name. A content, named a component, can also inherit from other definitions. Components proposal also contains other features. See (main site) http://www.lifl.fr/~dumoulin/components (mirror) http://www.geocities.com/cedricdumoulin/components/ I am currently working on the possibility to define or modify the template/component inside the action or inside the jsp. This will be available soon (see a previous mail 'Re: PROPOSAL: Template Screens'). Furthermore, useful Components features will be progressively introduce in Struts version 1.1 For your first question, see intermixed. Cedric Vincent Harcq wrote: > Hi, > > 1. I am beginning to look at Templating mechanism and so use the example > struts-template using version pre-beta-2 (23/03/01). > The result is a strange for me. Can somebody explain me this. > On the first page, when I look at the generated code (look at the end of > message), I got something where the side-bar.jsp and header.jsp is included > BEFORE the tag; while from what I see in chapterTemplate.jsp, the > should appear first. > Is there a problem somewhere ? Does somebody is aware of that ? Is it my > browser ? > What jsp server do you use ? This happens because your server doesn't flush included page. You can try to use the components library instead of template one, it is fully compatible. > > 2. I was also thinking about another mean of doing templating. The fact > that I have two create each 2 files (introduction.jsp and introduction.html) > is not really needed if you consider you have a little number of different > templates to work with. > Say you have only two templates (side-bar header content footer) (left-bar > header content right-bar footer), it is too much for me to create each time > the page that will use template:put. > I have done that before I used Struts in a "request processor" by setting > the value of a "content" field, forwarding to one of two pages template1.jsp > and template2.jsp that uses jsp include tags. > My plan was to do that in the findForward() method of ActionForwards and > forward all the time to one of the 2 template pages that I have and setting > the "content" value before. > To speak "philosophically", but wishing to not re-open this debate, the PUSH > method is for me more convenient that the "PULL" one for Page Templating > Mechanism. But I do not want to "mix" Velocity and Struts only""" to > solve this templating problem. > > > Any ideas ? > > HTML generated: > --- > > Topics > > > Introduction > > > Using Templates > > > Optional Content > > ... and more ... > > > > > > > > > > . . . > > _ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: Template -struts-template and generated HTML / templating using PUSH model
J'espere, que cela prendra en compte l'internationnalisation. Les fichiers de resources, ne permettent pas de gerer des pages stylisées. Ce qui m'interesserait, dans un systeme de templates, ce sont des feuilles de style (pas xsl) qui s'appliqueraient sur des beans, et qui permettrait au graphiste de définir globalement comment s'affiche l'objet, puis de l'utiliser via des tags. a+ Cedric Dumoulin a écrit : > Hi Vincent, > > Have a look to Components proposal. Components proposal can be seen as > "extended templates". With Components you can define your template's > contents/attributes in a separate file, and insert content by using its name. A > content, named a component, can also inherit from other definitions. Components > proposal also contains other features. > See (main site) http://www.lifl.fr/~dumoulin/components > (mirror) http://www.geocities.com/cedricdumoulin/components/ > > I am currently working on the possibility to define or modify the > template/component inside the action or inside the jsp. This will be available > soon (see a previous mail 'Re: PROPOSAL: Template Screens'). > Furthermore, useful Components features will be progressively introduce in > Struts version 1.1 > > For your first question, see intermixed. > > Cedric > > Vincent Harcq wrote: > > > Hi, > > > > 1. I am beginning to look at Templating mechanism and so use the example > > struts-template using version pre-beta-2 (23/03/01). > > The result is a strange for me. Can somebody explain me this. > > On the first page, when I look at the generated code (look at the end of > > message), I got something where the side-bar.jsp and header.jsp is included > > BEFORE the tag; while from what I see in chapterTemplate.jsp, the > > should appear first. > > Is there a problem somewhere ? Does somebody is aware of that ? Is it my > > browser ? > > > > What jsp server do you use ? This happens because your server doesn't flush > included page. > You can try to use the components library instead of template one, it is fully > compatible. > > > > > 2. I was also thinking about another mean of doing templating. The fact > > that I have two create each 2 files (introduction.jsp and introduction.html) > > is not really needed if you consider you have a little number of different > > templates to work with. > > Say you have only two templates (side-bar header content footer) (left-bar > > header content right-bar footer), it is too much for me to create each time > > the page that will use template:put. > > I have done that before I used Struts in a "request processor" by setting > > the value of a "content" field, forwarding to one of two pages template1.jsp > > and template2.jsp that uses jsp include tags. > > My plan was to do that in the findForward() method of ActionForwards and > > forward all the time to one of the 2 template pages that I have and setting > > the "content" value before. > > To speak "philosophically", but wishing to not re-open this debate, the PUSH > > method is for me more convenient that the "PULL" one for Page Templating > > Mechanism. But I do not want to "mix" Velocity and Struts only""" to > > solve this templating problem. > > > > > > > Any ideas ? > > > > HTML generated: > > --- > > > > Topics > > > > > > Introduction > > > > > > Using Templates > > > > > > Optional Content > > > > ... and more ... > > > > > > > > > > > > > > > > > > > > . . . > > > > _ > > Do You Yahoo!? > > Get your free @yahoo.com address at http://mail.yahoo.com
Re: Template -struts-template and generated HTML / templating using PUSH model
Hi Vincent, Have a look to Components proposal. Components proposal can be seen as "extended templates". With Components you can define your template's contents/attributes in a separate file, and insert content by using its name. A content, named a component, can also inherit from other definitions. Components proposal also contains other features. See (main site) http://www.lifl.fr/~dumoulin/components (mirror) http://www.geocities.com/cedricdumoulin/components/ I am currently working on the possibility to define or modify the template/component inside the action or inside the jsp. This will be available soon (see a previous mail 'Re: PROPOSAL: Template Screens'). Furthermore, useful Components features will be progressively introduce in Struts version 1.1 For your first question, see intermixed. Cedric Vincent Harcq wrote: > Hi, > > 1. I am beginning to look at Templating mechanism and so use the example > struts-template using version pre-beta-2 (23/03/01). > The result is a strange for me. Can somebody explain me this. > On the first page, when I look at the generated code (look at the end of > message), I got something where the side-bar.jsp and header.jsp is included > BEFORE the tag; while from what I see in chapterTemplate.jsp, the > should appear first. > Is there a problem somewhere ? Does somebody is aware of that ? Is it my > browser ? > What jsp server do you use ? This happens because your server doesn't flush included page. You can try to use the components library instead of template one, it is fully compatible. > > 2. I was also thinking about another mean of doing templating. The fact > that I have two create each 2 files (introduction.jsp and introduction.html) > is not really needed if you consider you have a little number of different > templates to work with. > Say you have only two templates (side-bar header content footer) (left-bar > header content right-bar footer), it is too much for me to create each time > the page that will use template:put. > I have done that before I used Struts in a "request processor" by setting > the value of a "content" field, forwarding to one of two pages template1.jsp > and template2.jsp that uses jsp include tags. > My plan was to do that in the findForward() method of ActionForwards and > forward all the time to one of the 2 template pages that I have and setting > the "content" value before. > To speak "philosophically", but wishing to not re-open this debate, the PUSH > method is for me more convenient that the "PULL" one for Page Templating > Mechanism. But I do not want to "mix" Velocity and Struts only""" to > solve this templating problem. > > > Any ideas ? > > HTML generated: > --- > > Topics > > > Introduction > > > Using Templates > > > Optional Content > > ... and more ... > > > > > > > > > > . . . > > _ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com