Enumeration Objects + Tomcat 4

Hi
I was wondering if anyone can help. I am new to JSP and have recently installed Tomcat 4.
In a JSP file, I had the following code:
<% Enumeration parameters = request.getParameterNames();
while(parameters.hasMoreElements()){
String parameterName = (String)parameters.nextElement();
String parameterValue = request.getParameter(parameterName); %>
<TR>
<TD><%=parameterName%></TD>
<TD><%=parameterValue%></TD>
</TR>
<% } %>
But everytime I try to run the jsp file, I get the following error:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occured between lines: 47 and 50 in the jsp file: /yasdev/dynamicForm.jsp
Generated servlet error:
C:\tomcat\work\localhost\examples\yasdev\dynamicForm$jsp.java:154: Class org.apache.jsp.Enumeration not found.
Enumeration parameters = request.getParameterNames();
^
1 error
     at org.apache.jasper.compiler.Compiler.compile(Unknown Source)
     at org.apache.jasper.servlet.JspServlet.loadJSP(Unknown Source)
     at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(Unknown Source)
     at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Unknown Source)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
     at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
     at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
     at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
     at org.apache.catalina.valves.AccessLogValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
     at org.apache.catalina.connector.http.HttpProcessor.run(Unknown Source)
     at java.lang.Thread.run(Thread.java:484)
Can anyone help? Why is there an error with the Enumeration Object??
Thank You
Yaz

Enumeration is part of the java.util package. You must import it or specify it fully as java.util.Enumeration.

Similar Messages

  • Looping thru enumeration objects

    How to loop thru the enumeration objects?? Thanks.

    If you are using JAVA 5.0 enum, here is an example:
    public class Example
        public enum Season { WINTER, SPRING, SUMMER, FALL }
        public static void main(String[] args)
            for (Season s : Season.values())
                System.out.println(s);
    }

  • Is it possible to persist an enumerated object as a string

    I created a java object for an enumerated type (greatly simplified for this
    discussion):
    public class Role implements java.io.Serializable {
    public Role() {
    private Role(String role) {
    this.role = role;
    public String toString() {
    return role;
    public String getRole() {
    return role;
    private String role;
    public static final Role GUEST = new Role("GUEST");
    public static final Role REGISTERED_USER = new Role("REGISTERED_USER");
    public static final Role TRIAL_USER = new Role("TRIAL_USER");
    The problem is it's persisted as a first class entity. That means in the
    CustomerType table I get hundreds of them, one for each relation. The
    solution for that is to use JDO to get an existing CustomerType from the
    datastore as use it for assignments instead of just using the class itself.
    But I'm curious, are there extensions that would allow me to map
    CustomerType to a string column in a table? For example, a Customer has a
    CustomerType. Can CustomerType map to a string column in the Customer
    table? Is this possible? I think this would be really cool, because then I
    can say:
    Customer c = new Customer();
    c.setCustomerType(CustomerType.GUEST);
    without having to retrieve the CustomerType.GUEST from the datastore.
    Michael

    Michael-
    Also note that Kodo 2.5.0 introduces a StirngifiedMapping, which enables
    simple persisting of things like enumerations (and anything else that
    can be round-tripped via stringification).
    Take a look at samples/scoStringification/ in the 2.5.0 release.
    In article <[email protected]>, Michael Mattox wrote:
    I found a solution to this, although from a different approach. Earlier I
    said a Customer has a CustomerType. I changed that relation to say a
    Customer has a String called customerType. Then I changed the
    getter/setters to use the CustomerType. This gives me the advantage of
    using an enumerated type with the ability to store a simple String in the
    database.
    So far this approach is working well. If you have any comments let me know.
    Michael
    "Michael Mattox" <[email protected]> wrote in message
    news:[email protected]...
    I created a java object for an enumerated type (greatly simplified forthis
    discussion):
    public class Role implements java.io.Serializable {
    public Role() {
    private Role(String role) {
    this.role = role;
    public String toString() {
    return role;
    public String getRole() {
    return role;
    private String role;
    public static final Role GUEST = new Role("GUEST");
    public static final Role REGISTERED_USER = new Role("REGISTERED_USER");
    public static final Role TRIAL_USER = new Role("TRIAL_USER");
    The problem is it's persisted as a first class entity. That means in the
    CustomerType table I get hundreds of them, one for each relation. The
    solution for that is to use JDO to get an existing CustomerType from the
    datastore as use it for assignments instead of just using the classitself.
    But I'm curious, are there extensions that would allow me to map
    CustomerType to a string column in a table? For example, a Customer has a
    CustomerType. Can CustomerType map to a string column in the Customer
    table? Is this possible? I think this would be really cool, because thenI
    can say:
    Customer c = new Customer();
    c.setCustomerType(CustomerType.GUEST);
    without having to retrieve the CustomerType.GUEST from the datastore.
    Michael
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Cannot Create HttpSession Object Tomcat 4.1

    Hi,
    I have a Servlet application that works fine on my local machine but when I try to deploy it on a commercial web server the program 'freezes' when it gets to the point in the program where a HttpSession object is created it simply stops with no Exception thrown.....
    Any help would be greatly appreciated
    Thanks in advance
    Kev

    post your code..

  • How to get tomcat installtion path, java path n documents path in a servlet

    may someone help me get the folder and pathname for tomcat, java path and library path and also the pathname where the jsp documents are stored.
    Thanks in advance
    null

    Have a look at System.getEnv(String) and System.getProperties();
    String tomcatHome = System.getEnv("CATALINA_HOME");
    Properties props = System.getProperties();
              Enumeration<Object> keys =  props.keys();
              while(keys.hasMoreElements())
                   String key = (String) keys.nextElement();
                   String prop = System.getProperty(key);
                   System.out.println(key +" : " + prop);
              }

  • Error in Tomcat log and localhost_log after  BO XI2 SP3 install

    Hi,
    After installing SP3 on my server I am getting the following error message in the localhost_log.2008-09-17.txt.
    Caused by: java.lang.IllegalStateException: Context path /businessobjects/enterprise115/desktoplaunch is already in use
         at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:896)
    As well when I start Tomcat a severe error message apears.
    I have replaced web.xml and struts-InfoView.xml with the original version.
    Location:C:\Program Files\Business Objects\Tomcat\webapps\businessobjects\enterprise115\desktoplaunch\WEB-INF
    When I conncet to IfoView, it seems to work, except some activex buttons are "red Xed".
    Thank you for your help,
    Alex

    Error-Page tags work best with an error.html pages. If you have an error.jsp page what I would do, and I have, is wrap my classes and jsp pages in a try catch block where you forward to the error jsp page and display anything you want. YOu can also do this with if else statements. I have used the tomcat error pages before but when I've implemented them I used java.lang.Exception as the error to catch not Throwable. I don't know if this would make a difference or have anything to do with your problem.

  • Business Objects XIR2 Infoview login issue

    Hello -
    I have a typical issue with BO Infoview login screen where the system name is showing incorrectly. The value should be coming from the configuration from web.xml file but it shows a totally different name with no option to update it. I checked the windows registry and system valiarbles but I haven't found anywhere on the system. Any ideas where this value is coming from ? Thanks.

    Thanks Denis. I see that the login issue has been resolved, but I noticed a different error when I login and logout from CMC. Here's the error message... not sure if this is connected to the previous one.
    D:\Program Files\Business Objects\Tomcat\work\Catalina\localhost\jsfadmin\org\apache\jsp\adminPages\Common\PreLogoff_jsp.java:78: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier
    (try -source 1.4 or lower to use 'enum' as an identifier)
        while (enum.hasMoreElements()) {
               ^
    An error occurred at line: 17 in the jsp file: /adminPages/Common/PreLogoff.jsp
    Generated servlet error:

  • Enumeration how to go beginning element of a reqest.getParameterNames()

    if i do
    Enumeration enu_p = req.getParameterNames();
    twice will i get the parameterNames in same order - each time - i need to go through the list of paarmeter names twice in same order - if not how can i set the Enumeration object back to beginning so that i can go through each item twice?
    ie.i have an Enumeration object , i loop through each item and do stuff then i want to start from the beginning of the enumaration an loop throough again - how can i do this .
    or is it best to use some other collection object like list - if so how would i do that - could some one show some sample code - thanks
    Enumeration enu_p = req.getParameterNames();
          while(enu_p.hasMoreElements()){....do stuff...}
    //then need to set cursor  to beginning of enu_p and do
           while(enu_p.hasMoreElements()){....do stuff...}

    ok thanks - this is what i actually do now - but wasnt sure if i would get paramters in same order as i 'm trying to do set some attributes in a prepared statement dynamically ie. - if a parameter is entered by user then incude it in the query so round on while loop i'm finding all the case where a parameter is enetred so formulating the string for prepared statement and the in 2nd wjile loop im going round all paramters and setting the values into the ? postions of the prepared statement - not sure if it'll work and its a bit messey but couldnt think of a better way - does any one else know of a better way of building a dynamic prepared statement ?
    i'm going to post this under a new heading as my real question is is there a better way of creating a dynamic prepared statement

  • Returning an Enumeration....

    public java.util.Enumeration getFtpInfo() {
            try {
               return ftp.getFeatures();
            } catch (FtpException ex) {
                ex.printStackTrace();
        }The above method is supposed to return an Enumeration object however because the getFeatures() method throws an exception it must be caught. The problem I have is that the compiler complains and says "return satatement missing".... but it is there !! I am thinking this might be because if an exception is caught then the return statement is never executed. How can I then add another return statement? ..
    Thanks in advance

    You need to return something.
    return the object outside of your try/catch block.
    This means using a temp object as a place holder so you can return it.

  • Custom Data Type and Enumeration

    We use MSSql Server and the database has some tables which has custom
    fields with restrictions. Can I map Enumeration object to these fields?
    Something like this -: Employee table has Type field which can have value
    of Manager, Programmer, CEO. Can Employee class with Enumeration object
    for Type be mapped? If yes, can reversemappingTool generate such class
    with some options?

    The reverse mapping tool cannot reverse-map enumerated types without
    some significant customizations. However, the Kodo runtime can support
    enumerated types through our general externalization feature:
    http://www.solarmetric.com/Software/Documentation/latest/docs/ref_guide_mapping_fieldmapping.html#ref_guide_mapping_fieldmapping_extern
    The samples in samples/externalization include an example of using
    externalization to support an enumerated type.
    The easiest thing would be to add the externalization metadata
    extensions and code to the files generated by the reverse mapping tool
    by hand.

  • Casting Enumeration to Iterator

    The element() method of a Hashtable returns an Enumeration Object.
    I got the following code working fine...
    Hashtable h = new HashTable);
    // Things with the hashtable
    Iterator i =(Iterator) h.elements();
    //Here I am CASTING Elnumeration to Iterator
    while (i.hasNext()) {
    // i.next() kind of things
    Is this correct ???

    Many iterators implement both java.util.Enumeration and java.util.Iterator, but you shouldn't count on it.
    - Marcus

  • Sun's demo using enum doesn't seem to work for me

    I'm trying to run a demo from the Sun website, http://java.sun.com/docs/books/tutorial/java/nutsandbolts/switch.html, which includes the enum statement:
    public class SwitchEnumDemo {
        public enum Month { JANUARY, FEBRUARY, MARCH, APRIL,
                            MAY, JUNE, JULY, AUGUST, SEPTEMBER,
                            OCTOBER, NOVEMBER, DECEMBER }
        public static void main(String[] args) {
            Month month = Month.FEBRUARY;
            int year = 2000;
            int numDays = 0;
            switch (month) {
                case JANUARY:
                    // etc etc ...
            System.out.println("Number of Days = " + numDays);
    }However, copying-and-pasting the code into NetBeans, I get an error on the enum declaration stating: '';' expected. Warning: as of release 1.5, 'enum' is a keyword and may not be used as an identifier'. Well... I know that. Isn't that why I'm using it in the first place? Or am I confused?
    I'm using NeBeans 5.0 on Java 1.5.0_06.
    Any advice?
    Question 2: Once I get this thing working, is there any way I can get the month as an input from the user, without needing a long block stating
    if (input = "January") month = Month.JANUARY;
    else if (input = "Feburary") month = Month.FEBURARY;
      //etc etcThat is, can the string representation of a month be somehow kept within the enumerated Month itself, and that be used to check the user's input?
    Thanks for any advice!

    However, copying-and-pasting the code into NetBeans,
    I get an error on the enum declaration stating:
    '';' expected. Warning: as of release 1.5, 'enum'
    is a keyword and may not be used as an
    identifier'. Well... I know that. Isn't
    that why I'm using it in the first place? Or am I
    confused?
    I'm using NeBeans 5.0 on Java 1.5.0_06.I can't say for sure about that; it seems very odd. However, I do know that my IDE will warn me about those sorts of things if I configure my project for pre-1.5 operation. It allows me to say a project is for Java 1.4 even if I'm using a 1.5 JVM and will mention things like that so that forward compatibility can be considered. I don't suppose this could be the case with your situation?
    You might want to search for all instances of "enum" in your code, though, because it's hard to imagine the one instance which appears in the snippet you posted causing problems.
    Question 2: Once I get this thing working, is there
    any way I can get the month as an input from the
    user, without needing a long block stating{snip}
    Well, in this case you can just do
    for (Month m : Month.values())
        if (m.toString().equalsIgnoreCase(input))
            month = m;
            break;
    }or you can build a Map<String,Month> if you're looking for case-sensitive comparison.
    In general, however, you can put pretty much anything into an enum:
    public enum SomeEnum
        A(0),
        B(0),
        C(1),
        D(0),
        E(2);
        private int value;
        SomeEnum(int value)
            this.value = value;
        public int getValue()
            return value;
    // the following is perfectly legal
    SomeEnum e = methodThatReturnsSomeEnum();
    System.out.println(e.getValue());and you could use that to put some form of identifier in the enumeration object. I have a class around here somewhere which uses an enum to enumerate the operators in an expression parser; the Operator enum constructor accepts an int specifying the operator precedence.

  • Report Engine SDK - Rbean usage in standalone java application

    Post Author: Berndb
    CA Forum: JAVA
    In BOXI the rebean sdk is available in the Report Engine SDK.
    I remember that in the 6.5 world one could use RBEAN interface in a standalone java application.
    Is this still possible in BOXI R2?
    If yes can you supply a sample classpath which shows all libraries that needs to be assigned.
    Thanks in advance.
    bernd

    Post Author: datahog
    CA Forum: JAVA
    Ted's right, but for fun, take what you need from:
    <installation drive>:\Program Files\Business Objects\Tomcat\webapps\businessobjects\enterprise115\desktoplaunch\WEB-INF\lib
    and de-reference what's not needed when your project's done, but be careful.
    I've actually done some standalone Swing-based webi report renderers using https://xhtmlrenderer.dev.java.net/ + docHTMLView.getStringpart + TagSoup

  • Closing the browser in InfoView doesn't log the user off.

    In Business Objects XI R2 Infoview, closing the browser in InfoView doesn't log the user off no matter how you answer the subsequent popup question "A window has closed. Log off as well?" Is there a fix for this somewhere?

    hi,
    In InfoView, with Performance Management installed, user sessions fail to be released immediately when the Log Off button is clicked.
    If you click the logoff button in Infoview and watch the address bar you will notice that it actually goes to another page called default.htm. It does this really fast. That page is located at C:\Program Files\Business Objects\Tomcat\webapps\businessobjects\enterprise115\desktoplaunch\InfoView. Remove both the default.htm and index.html and reboot your Tomcat server. Open a browser and go to Infoview. Once you have gotten in to Infoview click the log off button. You will get and error from the tomcat server and that is because the page does not exist anymore. If you look in CMS under servers and CMS you will also notice it dropped the session as well. So if you create another Default.htm page of your own and just redirect to another page it all should work.
    However I did notice an interesting ADAPT in CHF15 :-
    http://support.businessobjects.com/CommunityCS/FilesAndUpdates/boxir2_en_chf15_readme.pdf
    ADAPT00576483 Patch ID: 39,216,665
    Also did u do any customization setting before ?

  • Error when refreshing report

    I received the error u201C AN ERROR HAS Occurred: NULL u201C when I leave the report open for more than 20 min. this happen when I clicking on the "NEXT " or u201CPREVIOUSu201D button(arrow) or refresh. Hope some one can help. 
    Thanks.
    Eddy

    Andy, here is how i fixed it:
    1.  Stop the Tomcat server in CCM
    2.  Go to c:\program files\business objects\tomcat\webapps\business objects\enterprise115\desktoplaunch\web-inf\web.xml file, then change these lines to look like this
    <listener>
    <listener-class>com.busnessobjects.sdk.ceutils.SessionCleanupListener</listener-class>
    </listener>
    <!--
    -->
    3. Search for timeout and change from 20 minites to your desire
    4. Save the file
    5. In CCM re-start Central Management Server, then Start the Tomcat server.
    good luck.
    Eddy.

Maybe you are looking for

  • How can you get around Smart Mix limit of foreground or background?

    I am having trouble dealing with this limit, when I would like to have three levels of audio. Highest Narration track , then Audio 1, then soundtrack. I wonder if a solution whould be to have just the audio and narration and then make a new AVI file.

  • Ibooks won't open my pdf files

    When i try to open pdf files from my browser ibooks starts to open them but the file blinks and disappears. I have to close the app and do this process again for about three times for the pdf to open. I have a lot of pdf files in my bookshelf and i a

  • Extension callback issue

    I've developed an extension which works perfect in InDesign. But in After effects callback function is not getting the value returned from JSX. Can anyone suggest/help ? ~ many thanks Ays.Hakkim

  • Ipod freezing computer when I connect it

    hello. My Ipod worked fine ever since I got it one week ago however two days ago each time I connect it to the computer to charge it freezes my computer. Is there any way to correct this?

  • Agent Grid Control

    Hi everyone, I have a doubt about this scenario, i can somebody can help me. We have a grid control 10g and much databases in our company in 10g. We have migrated of 10g to 11g a database of all. So my doubt is if i must install the agent grid contro