Using Java 5 enums on JSTL page

Hi,
Anyone any idea how to get at enums on a JSTL page, without using scriptlets? The dot notation doesn't appear to work.
regards,
dig

I don't think there is one directly.
enums were new with java1.5, and I don't think it has quite caught up.
However JSTL also doesn't deal with constants very well.
Probably your best bet would be to use the EnumMap and EnumSet classes to expose a set/map of the enum onto the page.
JSTL could at least deal with those.
What exactly are you trying to accomplish with the enum on the JSP page?

Similar Messages

  • How to use Java Beans In JSTL?

    Hi
    I want to know how to use Java bean in JSTL
    please explain this with giving any one example.
    Thanks-
    Swapneel

    A bean is obtain by <jsp:useBean> tag nd once bean is obtained we can get its property by using getProperty tag.

  • Using Java for dynamic web page content

    I've currently got a Perl program that I'd like to convert to Java. It merges two files that are stored on a web server and generates a "dynamic" HTML response.
    For example, if I have the following files on the server:
    File1:
    <Comment1>This stuff</Comment1>
    <Comment2>That stuff</Comment2>
    File2:
    <HTML>
    <Comment1><br><Comment2>
    </HTML>
    When I go to the URL
    www.mysite.com\cgibin\merge.pl?file1&file2
    the Perl program will produce a web page saying:
    This stuff
    That stuff
    The major obstical for the rewrite: NO JSP ALLOWED. It's not allowed by the ISP.
    Now for the questions:
    - Could this be done using Java?
    - How could I initiate the Java app and pass it the parameters? (applet tag, access Java inside Perl, use Java Script somehow)
    - Will an applet tag even work for this since the final page is generated completely from other files?
    Thank you very much for your help.

    If your ISP don't support JSP / Servlets,
    1.use any server side technolgy, something like ASP.
    2.Read the files and transform them as Strings (or StringBuffers).
    3.Pass these Strings as parameters to the applet (if you are forced to use java technology, otherwise you can do it using ASP itself).
    4.Construct the required format (content) in your applet.
    Don't forget that the stuff will be in applet but not a complete web page. The ideal solution is asking your ISP to provide JSP engine.

  • How to use Java Script in jspx pages of ADF Faces?

    I wanna invoke an Applet in a jspx using Java Script...
    How can I do this? :)

    check my other post..that's to know how to use js in jsf pages...not to invoke applet..
    Re: how to Add inline JavaScript to a Page 11G

  • Develpoing widgets using java in my jsp page

    hi all,,
    please help me how to delevop widget and embed in my jsp page,,
    and what are the tools needed to delelop widget,,,please help if you have any exaple,,

    thx skp,,
    i wants know more about widget,,what are those and how to develop and how to use them,,
    its urjent for me,,is there any link for that,,please help

  • How to use java class in jsp page of JSPProvider?

    Hello everybody.
    I created simple JSPProvider channel with portal amconsole and named it "jspprov1". Then I created "jspprov"1 directory under "/ets/opt/SUNWps/desktop/sampleportal". I put "index.jsp" in it. And it worked until I add this line into "index.jsp": <% @page import="jspprov1package.aclass1" %>. Then I created directory "jspprov1package" under "/ets/opt/SUNWps/desktop/classes" and put "aclass1.class" into it and into "/ets/opt/SUNWps/desktop/classes" itself. I created "aclass1.class" on the other machine (with no installed portal) in j2sdk1.4.1_02: "javac aclass1.java". The text of this class is simple:
    "package jspprov1package;
    public class aclass1{
    public int int_field = 10;
    But the page still don't work. It writes on the portal desktop "ERROR: Content is not available".
    Does anybody know why this happened?

    Sorry, there were mistakes in jsp page and java files.
    I maked the channel "show exceptions" and found them out.

  • Why use Java Enum as class attributes?

    From the sample entity code from ADF, I notice that an Enum class is used to contain all attributes of a class (as below). What are the benefits of using Enum here and not the traditional declaration {int EmpId, public int getEmpId(), public void setEmpId(int)} ; ? If this is a design pattern, what pattern is it? Thank you.
    public class EmployeeImpl extends EntityImpl {
    public enum AttributesEnum {
    EmpId {
    public Object get(UsersImpl obj) {
    return obj.getUserId();
    public void put(UsersImpl obj, Object value) {
    obj.setUserId((DBSequence)value);
    }

    I've used InstallAnywhere Now! to deploy basic apps to friends before. You can find it here:
    http://www.zerog.com/downloads_05.html
    It takes care of making your program executable on most operating systems. If you get any jvm errors when running the installer it creates for you then try packaging your program with a specific JVM. The size of your setup file will be a quite a bit larger, but if you're putting it on cd it shouldn't matter. I had a similar problem with InstallSheild when I tried it (maybe it was just me). Anyway, I decided to use this one because it was free and the program I used it for was written for a friend (that I didn't charge :-)
    Ryan

  • Using java class from JSP page

    I have a class that connects to the database and return the result in form of array of objects, now I wrote a tester and I was able to print the result on the console but when it came to JSP how can I use this class I am a bit confused, how can I declare an array of objects and save the result that comes from the class method
    note: my class is not a bean it is a service class that contain methods to retreive different information from the database.
    I would apritiate any help but please make it in sequence for example declaring an array to hold the result then call the method that returns the array of objects..etc
    please help, I am really confused and don't know what to write
    thank you

    You can access a class in the same way as a bean, after all a bean is just a class that follows a set of rules.
    You need to put your classes in packages to access them.
    I have 2 packages, params and DTO. I set the class that returns the Data Transfer Object, or array of objects up as I would a bean
    <jsp:useBean id="DTO" scope="request" class="params.DTO" />
    I think you skip the above declaration and access it directly in code using
    params.DTO();
    but setting it up as I would a bean allows me to simply use
    DTO();
    DTO is the class that passes back the array of objects.
    Objects themselves I have in a seperate package, also called DTO (sorry if this is confusing, made sense at the time :-) ) You dont need them in seperate packages, just helped me keep DTO objects seperate from business logic classes......
    Now before I use params.DTO() I declare a variable of the Object type DTO() returns
    <%! DTO.workSheet[] ws; %>
    So, ws is the object type that will be returned by params.DTO()
    Then to get my array of objects back from params.DTO() :-
    ws = DTO.workSheet(day);
    or if you dont like the bean declaration
    ws = params.DTO.workSheet(day);
    You need to put your packages under WEB-INF/Classes when using Tomcat
    So I have
    Tomcat 5.0\webapps\myApplication\WEB-INF\classes\params
    Tomcat 5.0\webapps\myApplication\WEB-INF\classes\DTO
    Under which reside the classes

  • How to pass parameters to a page invoked using java script.--- Very Urgent.

    Hello,
    I have an advanced Table in my page. In the first column there is a
    messageChoice. In the second column there is link item.On the link item i have set the following value for destination uri.
    javascript:var a=window.open('OA.jsp?page=/AutoSales/oracle/apps/per/auto/webui/AutoSurrogatesPG&retainAM=Y','a','height=500,width=900,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbar=yes'); a.focus();
    The user selects a value from the message choice and when he clicks on the link item, the value selected from the list should go to the new page invoked using java script as a parameter. I need the value selected from choice to generates few fields in the new page. I have preferred java script because i need the base page and a model window should open. I have tried using setForwardUrl() and setting '_blank' and new window for target frame property on the link item. But it isnt working. The new page is opening in the same window.
    I have also tried putting the value in a session.
    Please help with any kind of suggestions or solutions.
    Thank you.

    Uma,
    You need to
    - Have a PPR Action on the messageChoice (this would trigger a form submit to populate the underlying View Attribute)
    - Either
    - Retrive the value from the View Attribute in the pop-up page (as I could see that you are retaining the AM)
    - Use a SPEL in the link (on the modal page) to use the value from the View Attribute as the parameter value (in the form ${oa.current.<ViewAttributeName>)
    HTH

  • How to create hyperlink in Html page using Java

    Hello every one
    I want to know that how can I create a hyperlink in Html page using java ?
    Let for example
    I have code like this and i want to give hyperlink to it using java.
    rember that i am creating node using this id="name" which give me multiple value. and i want to assign diff link to each name..?
    <tr>
    <td ><span id="name"></span>
    </tr>

    but i m using this code to create node in html file
    HTMLLIElement li = (HTMLLIElement)appHTML.createElement("LI");
    Text txt = appHTML.createTextNode(name);
    li.appendChild(txt);
    appHTML.getElementById("name").appendChild(li);
    this will display all name value which is coming from database,
    and i want to assign a hyperlink to it,
    I have id with name also so I thought that using id i will
    create javascript like
    function popup(id)
         if(id==1)
              var n1 = window.open("../list/name1.html");
         if(id==2)
              var n1 = window.open("../list/name2.html");
    this way i want to popup particular file if i can pass id value in this function
    so want hyperlink like
    name

  • How to get the page numbers of a word/mpp/execl doc using Java?

    Hi,
    I meet a problem in Java programming. I want to get the page numbers of a Word/MPP/EXECL/PDF document. For exmaple, if a PDF docment have 10 pages, I need get the 10 . How to get it using Java?
    Please advise me as soon as possible if you have any good suggestions! Thanks!
    Yin

    There are several good tools that allow you to access COM objects from Java. Here are two of the better ones:
    Bridge2Java
    http://www.alphaworks.ibm.com/tech/bridge2java
    J-Integra
    http://www.linar.com/
    Both of these tools will allow you to access MS Office products (including Word and Excel) via COM interfaces.

  • How & where to use Java script to create new button in object detail page

    Hi All,
    I want to create "New/Add button" in object detail page. If i am not wrong i need to use java script for that but could you please let me know how & where to use Java script to create new button in object detail page in CRMOD.
    Thanks in advance.
    Regards,
    Manish

    Any related object on the detail page should have an "Add" or "New" or both buttons by default - This is vanilla functionality and will do the required action.
    If you want to modify this behaviour and do something tricky you will potentially have to go for javascript. You should add the javascript on a custom web tab on that Object.
    Admin --> Application Customization --> Contact -->Contact Web Applet
    Now, add your javascript in the code area, after you select the type = HTML for this web applet, expose this web applet on the Contact detail layout and your javascript will be invoked whenever this page is loaded.
    Check this online document to see how javascript can be embedded in CRM on Demand http://helponmyproject.com/TTOCOD/
    Cheers!
    Royston

  • Using Java 5, how to develop customizable web-pages  like iGoogle ?

    Is it possible to develop customizable web-pages like iGoogle does, using Java 5 ( simply using JSPs, servlets, JSFs, AJAX etc. and without using portals) ?
    A simple example explaining how to provide 3-4 header graphics options ( like igoogle does) will be helpful. (iGoogle seems to create a cookie, which appears to be used to render the selected header-graphics).
    TIA
    Edited by: DevelopingJava2005 on Jul 7, 2008 9:36 AM

    Without using portals?
    Google uses RSS feeds to compile their mashups on iGoogle. The positioning of those boxes are managed with AJAX and upon placement are saved into a session so they stay there for each visit after.
    Please be a little more clear as to what you are looking for. Yes, it is possible to develop web pages using the technologies you specified to simulate something like iGoogle, so give us some more details on what exactly you're looking for.
    Code wouldn't hurt either.

  • Problem with too small page size using Java 2D Printing API.

    Hello,
    I have problem with resolution of printer using Java 2D Printing API. Despite my printer has 600 x 600 DPI, inside java.awt.print.Printable.print(Graphics, PageFormat, int) I receive page format with 600 x 840 page size.
    I have tried to set resolution using javax.print.attribute.PrintRequestAttributeSetand javax.print.attribute.standard.PrinterResolution, but with no result.
    Can anybody solve this problem?
    Regards,
    Karl.

    600 x 840 is a Point value; Point is defined as 1/72nd of an inch. Printers do have much higher DPI than this, but I believe that this DPI has to do with richness of the printed image, not an actual ability to color with that level of resolution. You might want to try calling zoom on your Graphics2D object. Otherwise, I don't know what else you can try.

  • How can we  use java variable in javascript code on JSP page?

    How can we use java variable in javascript code on JSP page?
    Pls help

    Think about it:
    JSP/Java is executed on the Server and produces HTML+JavaScript.
    Then that HTML+JavaScript is transfered to the client. The client now interpretes the HTML+JavaScript.
    Obviously there's no way to access a Java variable directly from JavaScript.
    What you can do, however, is write out some JavaScript that creates a JavaScript variable containing the value of your Java variable.

Maybe you are looking for

  • IPod appears on Desktop - enable disk use checked, greyed-out

    Each of my daughters has a video iPod-- The "white" one - about 11 months old, now appears on the desktop when connected. iTunes opens, but the choice "enable disk use" is greyed-out, i.e. I cannot un-check this, and each time the iPod icon appears o

  • Xml parsing

    hi all i have a question here. how do you parse a string to an XML format? an example will be most helpful :) thanks in advance

  • Problem with JDBC

    Hi, sorry but in other forum nobody answer my question. the probles is using JDBC 2.0, my cod is: Statement c = conn.createStatement(); Statement =conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rest = n.e

  • Creating DATABASE in 10g installed in 64 bit windows 7

    hi please some buddy help me to create database in oracle 10g I have installed 10g in win7 64 bit.It is working properly but configuration assistant is not being installed thats why i am unable to create database.

  • MultiColumn sorting of context

    Hello Experts, I need to sort the context nodes, based on 2 attributes of the context, one attr in ascending and the other attr in descending. I referred to the link in wiki http://wiki.sdn.sap.com/wiki/display/Snippets/Tablesorterbymultiplecolumns(W