Thanks Mehdi,
That did the trick. I have now parsed the XML (finally), one last
thing, to anyone...
If a path to the XML file is provided or not, it is defaulting to
c:\WINNT\system32 hence if I place the XML file thus:
c:\WINNT\system32\stocks.xml , with the JSP calling it:
Document doc
Hi,
Similar to a recent posting, after some research into the subject,
regarding importing a package into my JSP, I understand thus:
If I have Abean.java and of course Abean.class belonging to package mybean
(source below), in webapps/mydir/WEB-INF/mybean/mybean.class, and my JSP
in we
Hi,
I have the package:
package dombean;
import ...*;
public class {etc.
the file is in mydir/WEB-INF/classes and has been compiled. The jsp that
imports it - <%@ page import="dombean.*" %> throws the error:
package does not exist
import dombean.*;
^
as does subsequent references
have you heard of doing something simultaneously? It seems many listees
have a problem with people doing this.
I shall check out the Jakarta Project forthwith.
[EMAIL PROTECTED] wrote:
>If the emails direct me to where the material is, rather than telling me
>to go look for it, I'll be
If the emails direct me to where the material is, rather than telling me
to go look for it, I'll be happy. My last few emails would suggest I am
looking around for stuff.
"You could find or make an xml parsing taglib."
I am trying to find one! Again, any 'direction' from the list, rather than
OK, here's my JSP:
<%@ taglib uri="myfile.xml" prefix="tl" %>
XML
As you can see, I am not even attempting to parse it yet. Both the JSP and
myfile.xml residfe in the same directory - webapps/mydir/...
Paul.
uri tells the tag where the xml file is.
What tag are you using to par
Hi,
In my quest to be able to parse a 10 line XML file in a JSP
(notice the sarcasm there?) and extract an element value, I have come
accross a few PDFs that talk of custom tags - and for the purposes of XML,
a taglib directive. In several examples I saw <%@ taglib uri="..."
prefix="tl"
Thanks, that worked, however when I implement an interafce thus:
public class LoadAtStartup implements ServletContextListener {
I get the errors:
LoadAtStartup.java:9: cannot resolve symbol
symbol : class ServletContextListener
location: class LoadAtStartup
public class LoadAtStartup implements
Hi,
I have for the past few hours been pulling my hair out trying to
compile a simple servlet. I haven't even got to the stage of trying to
implement it.
I have the default Tomact installation. defined in my classpath:
C:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet.jar
and
Ugh, thanks. I really dont know where to start however. How are the variables made
persistent? Can you possibly provide a little syntax?
Finally, what is ''? A directory?
Thnaks
Paul.
Hello Paul, if u use a parallel directory and "bean" class files w/
setter/getter methods u can persist
Hi Kwok,
To retrieve a variable defined in another page is all I wish to
do. In my main file I include: . In inc.jsp
is a String. After the include, it simply executes the page and any
reference to the variable in the inlcude file is illegal. How may I
include a file, and make the varia
I tried debugging the source through, my IDE and it threw a
java.lang.NoSuchMethodError: main
I tried compiling the source through the command prompt and got a load of
'cannot resolve symobol' errors (useful). Below is the entire servlet, any
ideas where the problem is? The first 2 of 5 errors
Thanks,
And what about a path to the class? Is one necessary? Is any
package declaration necessary?
If I'm not mistaken you put the java source of the servlet into
/WEB-INF/classes/, the directory takes class files not source files as
per specification.
So you will need to compile
Hello,
Is there anyhting like a server side inlcude that is loaded into
memory when the server starts, making variables specified in the include
file accessible?
Or is what I am trying to acheive (in previous posts) - session or
application to be loaded when the server is started - the
Hello
Why when I add:
LoadMycompServletAtStartup
to a sparsely populated local web.xml file (webapps/mydir/WEB-INF/web.xml)
does the system fail - 404 error?. Without this addition, the page loads.
The servlet 'LoadMycompServletAtStartup' is located:
webapps/mydir/WE
hello
Why when I add:
LoadMycompServletAtStartup
to a sparsely populated local web.xml file (webapps/mydir/WEB-INF/web.xml)
does the system fail? (404 error). Without this addition, the page loads.
The servlet 'LoadMycompServletAtStartup' is
webapps/mydir/WEB-INF/cla
Hi,
Pertaining to recent posts, can someone please describe how
session or application are defined in a servlet please? In JSP syntax
there is no problem but in the method in the .java servlet below:
public class LoadMyServletAtStartup implements ServletContextListener {
public voi
You mean as in application = some declaration? How is it declared? Like
session, I am used too just defining it, and thats it (in JSP). Like
session, is application not a keyword?
Thanks
Paul.
Kwok Peng Tuck <[EMAIL PROTECTED]>
25-11-2002 12:13
Please respond to "Tomcat Users List"
I am editing and compiling from NetBeans, it gives:
..[23:1] cannot resolve symbol
application.setAttribute("style_index", style_index);
^
1 Error
the entire line is underlined red in the editor
any ideas?
here is the entire servlet placed in myApp/WEB-INF/classes:
import java.io.*;
import j
Hello,
In my servlet to be started on server load, why may I not define
the application thus:
public void contextInitialized(ServletContextEvent sce) {
Hashtable style_index = new Hashtable();
style_index.put("element1", "ONE");
style_index.put("element2", "TWO");
Thanks,
And what about the location of the servlet? Must in reside anywhere
in particular?
paul.
web.xml in the /conf directory is global and applies to all webapps. If
you have anything specific for your webapp you should instead use the
web.xml in your webapp directory, specificall
Hi,
Further to a posting made a while ago - I wish to define some
session variables on the startup of Tomcat. I have added:
com.mycomp.servlet. LoadMyServletAtStartup
to conf/web.xml
and have my servlet source. Where (if anywhere specific) must I place it?
Have I
Thanks, but I am no longer using session. I have opted for 'application'.
How is the timeout set for that please?..or have you answered that
already? I f so I missed it!
Paul.
FYI: <%! Hashtable style_index = new Hashtable(); %>
application.setAttribute("style_index", style
Hi Kwok,
I looked at the docs you referenced and the method you mentioned
(setMaxInactiveInterval) was not present, and did not compile? If the method it is
available how
is it called? I have:
Hashtable hstyle = new Hashtable();
application.setAttribute("appstyle", hstyle); OK!
appst
Hello,
I am using 'application' to persist and make available simple text
values accessible to multiple clients. Can someone tell me how to set the
timeout value to this please (default lifetime)? I have acheived this with
HttpSession by editing my conf/web.xml file, but can see no refer
Hi,
I am looking into servlets to initialise string values every time
the service is started, making them accessible to multiple clients? To
define them is simple enough, but how can I make them accessible for all
clients?
Much appreciated
Paul.
Yeah I got that thanks. I was looking at the wrong web.xml. I want
conf/web.xml right?
P.
In my web.xml, I have (as a child of ), these lines.
30
This is in minutes.
David
On 11/21/2002 12:32 AM, [EMAIL PROTECTED] wrote:
>Regarding timout and web.xm
OK,
Perhaps then a session is not what is required here. I wish to
make available upon startup of the server, some simple string values. They
must be accessible to all clients, auto initialised when the service
starts up. This is something similar to a posting I made a while ago
reagrd
Regarding timout and web.xml..my web.xml looks like this:
Welcome to Tomcat
Welcome to Tomcat
In other words has not been adjusted a great deal. I could sit here for
hours and guess what the tag name is/are, and whether the arguement must
takes milliseconds, seconds, minutes etc.
Relating to the previous posting. Now I have my hastable stored as a
session, and am able to retrieve it, I would like the session to be
created when the service (TC) starts up, or is restarted. I.e I would
like the session to be available without initailsing it by loading a JSP
page.
Thanks
Thanks Gents, that's great. One last thing. Where is session in the API? I
can't see httpSession anywhere. I am looking for session settings to
define session life span etc.
Thanks
paul.
what ever it is, it worked! I remember doing this before however with no
cast necessary?
David Kavanagh <[EMAIL PROTECTED]>
21-11-2002 12:07
Please respond to "Tomcat Users List"
To: Tomcat Users List <[EMAIL PROTECTED]>
cc:
Subject:Re: hashtable
I th
it is an array object is it not? of type int ?
[EMAIL PROTECTED]
21-11-2002 12:11
Please respond to "Tomcat Users List"
To: "Tomcat Users List" <[EMAIL PROTECTED]>
cc:
Subject:Re: hashtable
My two cents:
1. int is a java primitive type and your assi
Great,
I have styles which is an int array (to become hashtable) and want to
retrieve it from another page (you assume correctly).
I have: session.setAttribute("styles", styles); which runs OK
and: session.getAttribute("styles", styles); which is throwing a compiler
error.
It's been a while
Hello,
Can anyone tell me, can a hash table be defined as a session and
retrieved from another page as can an array?
Thanks
Paul.
Let me finish that posting!!
What I was trying to say before I inadvertently hit send, is where
might I find documentation on installation? There is documentation
available prior to setup / download but that not alot as far as I can see
for installation.
Does anyone know?
Thanks
Hi,
I am checking out JDOM. It does indeed seem fulfill my needs. As a
result I've downloaded JDOM Beta 8.
Thus far however, I have not come across any literature for
installation. I have read the readme.txt which does not seem to describe
in great detail how to get started. I
Understood. And what implications would it have to use the Xerces parser
on the code in that page?
(http://www2.theserverside.com/resources/article.jsp?l=JSP-XML2)(DOM
approach)
finally, what is or what am I importing with:
import org.w3c.dom.*; ?
Thanks
Paul.
No need (and some would s
>It's all a bit much isn't it.
You're not wrong!
OK, having continued to study the article you quoted, I have downloaded
and installed the JWSDP (JAXP). In the same page that describes where to
download JAXP it says:
"To install, unzip it in a directory of your choice, and update the
classpat
I am looking at the article you suggested. While I am trying to digest it
all.. am I right in thinking you are proposing and what the article is
demonstrating is that I use the SAX approach to parse my XML (although SAX
'is not a parser'!) and not the Xerces parser?
Thanks
Paul.
You're fine
"I have downloaded the Xerces.ZIP (which incidentally is 4.8 MB - expanded
to 22!), extracted it to webapps/ROOT/WEB-INF/lib/"
I extrcated the xerxesImp1.jar to that location.
Paul.
Hi,
In my effort to parse an XML file and pull out data from it's
elements where I may maninpulate them, I have downloaded the Xerces.ZIP
(which incidentally is 4.8 MB - expanded to 22!), extracted it to
webapps/ROOT/WEB-INF/lib/. Is this the correct location? If not, where
should it resid
Thanks for your most comprehensive replies!
Paul.
Hello and thanks for that.
Attempting to install and Xerces parser, I downloaded
Xerces-J-bin.2.2.1.zip. In it I found the copious install and demos you
talk of as an exact duplicate of the web site! I think to author the
documentation someone simply went into his /her browser and and h
Hi,
I wish to parse XML using the Apache Tomcat server (4.1.12). I
understand all recent releases support the parsing of XML. Can someone
pont me in the direction of web pages / resources / whatever, where I can
get my hands on syntax to acheive this please?
Thanks
Paul.
46 matches
Mail list logo