Help with displaying errors in jsp using html:errors/

Here is my problem.
In my overridden ActionForm.validate() method, i am returning ActionErrors (as required). When there are input errors in my form submission, the control goes back to the JSP page i used to read user input (so far so good). The JSP page is rendered fine for taking input for the second time but no errors are displayed although i am using the tag <html:errors/>
I tried to find the org.apache.struts.action.ERROR in my request attributes and it is there with the size of 1 (because i am reporting one error, in my sample run). Any idea why <html:errors/> won't display the errors even though they are there??? Here is what i am doing in my ActionForm class:
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (this.email == null || this.email.length() < 1) {
errors.add("username", new ActionError
("error.username.required"));
return errors;
Any help is appreciated.

First of all, thanks for taking time to look at my message. Here is how my message-resources tag look like in struts-config.xml file:
<message-resources parameter="ApplicationResources"/>
The "ApplicationResources.properties" file exist in the WEB-INF folder of my application and following are the entries in that file that i think are relevant:
errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
errors.footer=</ul><hr>
error.username.required=<li>Username is required</li>
Is there anything else needed to go into resource file? Or should i put my resource file somewhere else?

Similar Messages

  • @Return - Help with displaying error correctly

    Hi,
    I'm trying to use the @Return function to block users from entering a negative value in the 'FTE' member of the 'F T E' dimension.  When I run the below from Business Rules menu it displays the error correctly in a window.  However when I run when it's attached to a webform which I need, the error displays as:
    Error Detected while attempting to run job:  AAA - Non Discretionary Allocation - Budget.
    ADF_FACES-60097: For more information, please see the servers' error log for an entry beginning with:  ADF_FACES-60096:Server Exception during PPR, #3
    So my question is why does it work perfectly from Business Rules menu but not from the Webforms?
    Fix (  "No FTE" )
             "512100" (
             If(@ISMBR("8900"))
             If("FTE" < 0)
             @RETURN( @CONCATENATE(
                                 @CONCATENATE("Negative values are not allowed as input into the dimension 'F T E' for member:[", @NAME(@CURRMBR("F T E"))),
                                 "]. Please input a value greater or equal to zero to continue.")
             , ERROR);
            ELSE
             @Round("FTE" * "Avg School Principal Salary"->"No Dept"->"Preliminary (Rolled)"->"No Fund"->"No Program",-2);
             Endif Endif )

    Is that your real script? If you are only looking at "No FTE" (assuming it is from "F T E" dimension) why currmbr?
    What is 8900 and 512100 are they accounts? If so why are you opening 512100 and checking for 8900?
    If I were you and trying something like this and hit and error, I would try to put a value and see if that works or not. So if FTE<0 put 1 else put the formula.
    Regards
    Celvin

  • Need a little help with some errors.

    Receiving some errors..
    btn2.addActionListener(new ActionListener() {
    and also
    frame.setLocation(400,400);
    frame.setVisible(true);
    }<<~~has 2 errors here...
    Both above have class or interface expected errors..clueless on what i'm missing at the moment.
    Anyone mind pointing out what {'s and }'s i'm missing?
         btn1.addActionListener(new ActionListener() {
                             public void actionPerformed(ActionEvent evt) {
                                  btn1actions();
              private void btn1actions() {
                   if (radio1.isSelected()) System.out.println("Radio Button 1 is selected.");
                   if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.");
         btn2.addActionListener(new ActionListener() {
                                       public void actionPerformed(ActionEvent evt) {
                                            btn2actions();
                        private void btn2actions() {
                             if (radio1.isSelected()) System.out.println("Radio Button 1 is selected.");
                             if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.");
                   btn3.addActionListener(new ActionListener() {
                                       public void actionPerformed(ActionEvent evt) {
                                            btn1actions();
                        private void btn3actions() {
                             txt1.setText("");
                             txt1.requestFocus();
    public static void main(String[] args) {
        Test2 frame = new Test2();
        frame.setTitle("Test Frame");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(400, 300);
        frame.setLocation(400,400);
        frame.setVisible(true);
    }

    All my code..finally posted...just need help with more errors.
    F:\DocumentsTest2.java:169: ';' expected
              btn1.addActionListener(new ActionListener()) {
    ^
    F:\Documents\Test2.java:176: illegal start of expression
              private void btn1actions() {
    ^
    F:\Documents\Test2.java:191: illegal start of expression
              private void btn2actions() {
    ^
    F:\Documents\.java:202: illegal start of expression
              private void btn3actions() {
    ^
    4 errors
    Tool completed with exit code 1
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test2 extends JFrame{
         static JButton btn1,btn2,btn3;
         static JTextField txt1;
         static JRadioButton radio1,radio2;
           public Test2() {
             Container container = getContentPane();
             container.setLayout(new BorderLayout());
              //Create Panels
                JPanel Panel1 = new JPanel();
                JPanel Panel2 = new JPanel();
                JPanel Panel3 = new JPanel();
                JPanel Panel4 = new JPanel();
                JPanel Panel5 = new JPanel();
                JPanel Panel6 = new JPanel();
                JPanel Panel7 = new JPanel();
                JPanel Panel8 = new JPanel();
                JPanel Panel9 = new JPanel();
                JPanel Panel10 = new JPanel();
              //Set Layout for Panels
              Panel3.setLayout(new BorderLayout());
              Panel4.setLayout(new BorderLayout());
              Panel5.setLayout(new BorderLayout());
              Panel6.setLayout(new BorderLayout());
              Panel10.setLayout(new BorderLayout());
              //Create the Various Fonts and Colors for this GUI
              Font font1 = new Font("SansSerif", Font.BOLD, 20);
              Font font2 = new Font("Serif", Font.PLAIN, 15);
              Color color1 = new Color(3,15,125);//A Dark Blue Color
              Color color2 = new Color(201,29,10);//A Red Color
              Color color3 = new Color(127,127,127);//A Grey Color
              //Create Buttons and Labels
             btn1 = new JButton("Submit");
             btn2 = new JButton("Display Schedule");
             btn3 = new JButton("Enter New Name");
             JLabel label1 = new JLabel("Student Name");
             JLabel label2 = new JLabel("Course Number");
              JLabel label3 = new JLabel("Welcome to the Java Community College");
              JLabel label4 = new JLabel("Registration System!");
              //Declare Text Field For Entering Student Names
              txt1 = new JTextField(15);
              //"Put Course Number from another Method Here"
              String[] courseStrings = { "CISM2230 A", "CISM2230 B", "CISM1110 A", "CISM1110 B", "CISM1120 A", "CISM1120 B" };
              JComboBox Combo1 = new JComboBox(courseStrings);
              //Declare Radio Buttons for Add and Drop Course
              radio1 = new JRadioButton("Add a Course", false);
              radio2 = new JRadioButton("Drop a Course", false);
              ButtonGroup radioButtons = new ButtonGroup();
              radioButtons.add(radio1);
              radioButtons.add(radio2);
              //Panel 10 is the Main Displaying Panel
              Panel10.add(Panel3, BorderLayout.NORTH);
              Panel10.add(Panel4, BorderLayout.CENTER);
              Panel10.add(Panel8, BorderLayout.SOUTH);
              //Panel 3 Used to Display Label 3 and 4 using Panels 1 and 2
              Panel3.add(Panel1, BorderLayout.NORTH);
              Panel3.add(Panel2, BorderLayout.CENTER);
              Panel1.add(label3);
             Panel2.add(label4);
              //Panel 4 Used to Display Student Name, Txt1, Course Number, Combo Box and Radio Buttons
             Panel5.add(label1, BorderLayout.NORTH);
             Panel5.add(txt1, BorderLayout.CENTER);
             Panel6.add(label2, BorderLayout.NORTH);
              Panel6.add(Combo1, BorderLayout.CENTER);
              Panel7.add(radio1, BorderLayout.NORTH);
              Panel7.add(radio2, BorderLayout.CENTER);
              Panel4.add(Panel5, BorderLayout.NORTH);
              Panel4.add(Panel6, BorderLayout.CENTER);
              Panel4.add(Panel7, BorderLayout.SOUTH);
              //Panel 8 Used to Display the Buttons
              Panel9.add(btn1, BorderLayout.CENTER);
              Panel9.add(btn2, BorderLayout.CENTER);
              Panel9.add(btn3, BorderLayout.SOUTH);
              Panel8.add(Panel9, BorderLayout.CENTER);
              //Setting Background, ForeGround and Font of all Text.
             Panel1.setBackground(color3);
             Panel2.setBackground(color3);
             Panel3.setBackground(color3);
             Panel4.setBackground(color3);
             Panel5.setBackground(color3);
             Panel6.setBackground(color3);
             Panel7.setBackground(color3);
             Panel8.setBackground(color3);
             Panel9.setBackground(color3);
             Panel10.setBackground(color3);
             btn1.setBackground(color3);
             btn2.setBackground(color3);
             btn3.setBackground(color3);
             radio1.setBackground(color3);
             radio2.setBackground(color3);
             btn1.setFont(font2);
             btn2.setFont(font2);
             btn3.setFont(font2);
             Combo1.setFont(font2);
             Combo1.setBackground(color3);
             Combo1.setForeground(color1);
             label1.setFont(font2);
             label2.setFont(font2);
             label3.setFont(font1);
             label4.setFont(font1);
             label1.setForeground(color2);
             label2.setForeground(color2);
             label3.setForeground(color1);
             label4.setForeground(color1);
             container.add(Panel10);
              //Setting Keyboard Shortcuts to Radio Buttons and Regular Buttons
              btn1.setMnemonic('S');
              btn2.setMnemonic('D');
              btn3.setMnemonic('E');
              radio1.setMnemonic('A');
              radio2.setMnemonic('C');
              //ActionListener
              btn1.addActionListener(new ActionListener()) {
                   public void actionPerformed(ActionEvent evt) {
                        btn1actions();
              private void btn1actions() {
                   if (radio1.isSelected()){ System.out.println("Radio Button 1 is selected. Button 1")};
                   if (radio2.isSelected()){ System.out.println("Radio Button 2 is selected. Button 1")};
              btn2.addActionListener(new ActionListener()) {
                   public void actionPerformed(ActionEvent evt) {
                                            btn2actions();
              private void btn2actions() {
                   if (radio1.isSelected()) System.out.println("Radio Button 1 is selected(Button 2).");
                   if (radio2.isSelected()) System.out.println("Radio Button 2 is selected.Button 2");
              btn3.addActionListener(new ActionListener()) {
                   public void actionPerformed(ActionEvent evt) {
                        btn1actions();
              private void btn3actions() {
                   txt1.setText("");
                   txt1.requestFocus();
         public static void main(String[] args) {
             JavaCollegeTest2 frame = new JavaCollegeTest2();
             frame.setTitle("Project 4");
             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             frame.setSize(400, 300);
             frame.setLocation(400,400);
             frame.setVisible(true);
    }

  • Can anyone help me display the calendar list using an iphone4 wit iso 7.1.1?  I have already tried tapping the magnifying glass and that doesn't work.

    Can anyone help me display the calendar list using an iphone4 with iso 7.1.1?  I have already tried tapping the magnifying glass and that doesn't work.

    That icon allows for the calendar month to display with the appts for that month below.  I want to see only the list of appointments without the month displaying.  I use to be able to get that display but since the last update tapping the magnifiying glass doesn't work.

  • Please help with compiling error

    Hello, I am currently taking a class in Java Programming and need help with an error. I am working on a Mortgage Calculator and when I compile the code I get this error. I have no idea how to fix this. Can anyone help? Thank you.
    '{' expected public class MortgageCalculator
    1 error
    Tool completed with exit code 1
    Here is my code
    import java.io.*;//*java input output
    import java.util.Date;//Date Utility
    import java.util.Formatter;//format Utility
    import java.text.NumberFormat;//*format numbers
    //class MortgageCalculator
    public class MortgageCalculator
    public static void main(String[]args);{
    Date currentDate=newDate();
    DecimalFormat decimalPlaces=newDecimalFormat("0.00");
    //declare Variables
    final double principalBalance=200000;//*$200,000 Loan
    final double monthlyInterest=.06;//*6% interest rate
    final double Term=12*30;//*monthly interest rate
    final double monthlyInterest=((principalBalance*(monthlyInterest/12))/(1-Math.pow(1+(monthlyInterest/12))-(Term)));
    //Display Output
    System.out.println("\t\t" + currentDate);
    System.out.println("\t\tLoan Amount" + principalBalance);
    System.out.println("\t\tInterest Rate" + monthlyInterest);
    System.out.println("\t\tTerm of Loan" + Term);
    System.out.println("\t\tThe Payment will be:" + monthlyInterest);
    System.out.println(decimalPlaces.format(mothlyInterest));
    }

    You need to enclose your class body in { }. You're missing at least one of them

  • Help with the error message that ADE is not allowed to copy a book onto my Nook. I have tried authorizing and unauthorizing many times--at wits end with this issue.

    Help with the error message that ADE is not allowed to copy a book onto my Nook. I have tried authorizing and unauthorizing many times--at wits end with this issue.

    I too am having the same problem. I have a new hard drive that was imaged from the old one and I'm trying to side load a book to my Nook Simple Touch.. I first installed ADE 4 then borrowed and downloaded a book from Overdrive. I tried a few times to delete and reauthorize both the computer and the Nook and each time I get an authorization error when I try to side load the book. I then found on the Nook forum that the Simple Touch and ADE 4 don't get along. So I uninstalled ADE 4 and installed ADE 3.
    I then followed this recommended procedure found on the forum: I deleted the Digital Editions folder from my Nook, launched ADE 3 and authorized the computer, then connected the Nook. For a few seconds, hovering the mouse over the setting icon for the Nook displayed everything on the context menu grayed out. But then it showed the context menu and I was able to display the Nook's authorization, which was the same as the computer's. Still get the same error side loading the book. Deleting and reauthorizing doesn't help.  And the Digital Editions folder is still missing from the Nook.

  • Installing Elements 11 on Mac. Need help with install error "Setup wants to make changes."

    Installing Elements 11 on Mac 10.8.2. Need help with install error:  Setup wants to make changes. Type your password to allow this."  After entering Adobe password, nothing happens.  Locked from further installation.  Any ideas?  Adobe phone support could not help.

    Just before letting changes (installation in this case) be made on the system, Mac OS prompts for password & this has to be the Mac system password. This password prompt is the system's own native prompt & would accept the system password only. Please make sure it is the right system password (all/admin rights) and the installaion should run.

  • Can anyone help with this error? ;At line 102 of file"C:/Program files (x86)/Macromedia/Dreamweaver

    Can anyone help with this error please?;At line 102 of file"C:/Program files (x86)/Macromedia/Dreamweaver 8/Configuration/Objects/Common/Images.js"; TypeError: cmdDOM.parentWindow.setFormItem is not a function

    If Dreamweaver shows a message saying "the following JavaScript error(s) occurred",  it's usually a sign of a corrupt cache file. The first thing you should always be to delete the file cache. If that doesn't work, delete your personal Configuration folder. Please go through the steps mentioned in thread Deleting a corrupted cache file.

  • Help with CreateDefaultDomain error

    hello guy,
    Please i need help with this errors
    "*ERROR: An error occurred while building the default domain.*
    *Please see this log file for more details:*
    *C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\o.j2ee.adrs\CreateDefaultDomain.log*"
    This is the content of the log.
    *"Default domain will be created:*
    *C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\DefaultDomain*
    *C:\oracle\Middleware\wlserver_10.3\common\bin\wlst.cmd "C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\o.j2ee.adrs\CreateDefaultDomain.py"*
    *Process started*
    *wlst > 'C:\WINDOWS\system32\QTJava.zip' is not recognized as an internal or external command,*
    *wlst > operable program or batch file.*
    *Elapsed time: 609 ms".*
    this error is effecting the applications i built.
    thank
    kolly

    just check your parameter... it means that the parameter on showInputDialog on the API dont match with the parameter with your showInputDialog code

  • Help with code errors

    Can somebody help me get rid of the following compile errors:
    coreservlets/OrderPage.java:61: setNumOrdereed(int, int) in coreservlets.ShoppingCart
    cannont be applied to (java.lang.String,int)
    cart.setNumOrdered(recordingid, numItems);
    .\coreservlets\shoppingCart.java:44 cannot resolve symbol
    symbol : variable recordingid
    location: class coreservlets.ShoppingCart
    if (order.getrecordingid() == (recordingid)) {
    .\coreservlets\ShoppingCart.java:49: cannot resolve symbol
    symbol : variable recordingid
    location: class coreservlets.ShoppingCart
    itemOrder new order = new ItemOrder(Catalog.getItem(recordingid));I know that not very helpful with out the code but the code is very big so if anyone wants me to post extracts from the code please tell me.

    Thank you i put that code in but now get the following:
    coreservlets/OrderPage.java:40:  incompatible types
    found : java.lang.strgin
    required: int int recordingid = request.getParameter("recordingid")!=null?request.getParameter("recordingid"):1;
    ^/code]
    coreservlets/OrderPage.java:48: addItem(java.lang.String) in coreservlets.ShoppingCart cannot be applied to (int)
    cart.additem(recordingid);
    .\coreservlets\AhoppingCart.java:44: cannot resolve symbol
    symbol: variable recordingid
    location: class coreservlets.ShoppingCart
    if (order.getrecordingid() == (recordingid)) {
    .\coreservlets\AhoppingCart.java:49: cannot resolve symbol
    symbol: variable recordingid
    location: class coreservlets.ShoppingCart
    ItemOrder newOrder = new ItemOrder(Catalog.getItem(recordingid));
    4 errors.
    Also could you explain what the line you added to the code means:
    !=null?request.getParameter("recordingid"):1;
    !=null?request.getParameter("numItems"):"1";and how come you got rid of if (recordingid != null) {Thanks for any help with these errors
    OK I HAVE GOT RID OF ALL THE ERRORS APART FROM THE TOP ONE:
    code]coreservlets/OrderPage.java:40: incompatible types
    found : java.lang.strgin
    required: int
    int recordingid = request.getParameter("recordingid")!=null?request.getParameter("recordingid"):1;
                                            /code]
    Message was edited by:
            ajrobson                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I want to display BLOB image in JSP Using  html tags IMG src=

    GoodAfternoon Sir/Madom
    I Have got the image from oracle database but want to display BLOB image using <IMG src="" > Html tags in JSP page . If it is possible than please give some ideas or
    Send me sample codes for display image.
    This code is ok and working no problem here Please send me code How to display using html tag from oracle in JSP page.
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="javax.swing.ImageIcon;" %>
          <%
            out.print("hiiiiiii") ;
                // declare a connection by using Connection interface
                Connection connection = null;
                /* Create string of connection url within specified format with machine
                   name, port number and database name. Here machine name id localhost
                   and database name is student. */
                String connectionURL = "jdbc:oracle:thin:@localhost:1521:orcl";
                /*declare a resultSet that works as a table resulted by execute a specified
                   sql query. */
                ResultSet rs = null;
                // Declare statement.
                PreparedStatement psmnt = null;
                  // declare InputStream object to store binary stream of given image.
                   InputStream sImage;
                try {
                    // Load JDBC driver "com.mysql.jdbc.Driver"
                    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
                        /* Create a connection by using getConnection() method that takes
                        parameters of string type connection url, user name and password to
                        connect to database. */
                    connection = DriverManager.getConnection(connectionURL, "scott", "root");
                        /* prepareStatement() is used for create statement object that is
                    used for sending sql statements to the specified database. */
                    psmnt = connection.prepareStatement("SELECT image FROM img WHERE id = ?");
                    psmnt.setString(1, "10");
                    rs = psmnt.executeQuery();
                    if(rs.next()) {
                          byte[] bytearray = new byte[1048576];
                          int size=0;
                          sImage = rs.getBinaryStream(1);
                        //response.reset();
                          response.setContentType("image/jpeg");
                          while((size=sImage.read(bytearray))!= -1 ){
                response.getOutputStream().write(bytearray,0,size);
                catch(Exception ex){
                        out.println("error :"+ex);
               finally {
                    // close all the connections.
                    rs.close();
                    psmnt.close();
                    connection.close();
         %>
         Thanks

    I have done exactly that in one of my applications.
    I have extracted the image from the database as a byte array, and displayed it using a servlet.
    Here is the method in the servlet which does the displaying:
    (since I'm writing one byte at a time, it's probably not terribly efficient but it works)
         private void sendImage(byte[] bytes, HttpServletRequest request, HttpServletResponse response) throws IOException {
              ServletOutputStream sout = response.getOutputStream();
              for(int n = 0; n < bytes.length; n++) {
                   sout.write(bytes[n]);
              sout.flush();
              sout.close();
         }Then in my JSP, I use this:
    <img src="/path-to-servlet/image.jpg"/>
    The name of the image to display is in the URL as well as the path to the servlet. The servlet will therefore need to extract the image name from the url and call the database.

  • Help with display glith using JList

    Hi, first post so bit of background - I'm teaching Java at the moment, am fine with command line but am dabbling more with Swing, despite certain glitches I always get ( e.g. the 7-segment display last year) but anyway....
    I've been trying to develop a little app that picks random boxers for a computer game. My current problem is that i am trying to add custom boxers and then update the JList and repaint the frame. When I add a boxer i can see it adding to the list, however it is unreadable and displayed too small.
    Forgive any bad coding etiquettes - its very much a work in progress from a relatively poor programmer ;)
    theBoxers is a JPanel containing the JLists, aWindow is the JFrame, customButton is a button to add a custom fighter - this gets a name from a field, and a weight from a combo box, adds it to an array and then attempts to add it to an array, then re-generate the lists
    customButton.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                        addCustom(customCombo.getSelectedIndex(),addCustomName.getText());
                             System.out.println(customCombo.getSelectedIndex() + addCustomName.getText());
                             theBoxers.repaint();
                             aWindow.repaint();
    public void addCustom(int theWeight, String theName)
              switch(theWeight)
                   case 0:          featherCustoms[featherCustomsSize]=theName;
                                  featherFighters = new JList(featherCustoms);
                                  featherCustomsSize++;
                                  break;
                   case 1:          lightCustoms[lightCustomsSize]=theName;
                                  lightFighters = new JList(lightCustoms);
                                  lightCustomsSize++;
                                  break;
                   case 2:          welterCustoms[welterCustomsSize]=theName;
                                  welterFighters = new JList(welterCustoms);
                                  welterCustomsSize++;
                                  break;
                   case 3:          middleCustoms[middleCustomsSize]=theName;
                                  middleFighters = new JList(middleCustoms);
                                  middleCustomsSize++;
                                  break;
                   case 4:          lightHeavyCustoms[lightHeavyCustomsSize]=theName;
                                  lightHeavyFighters = new JList(lightHeavyCustoms);
                                  lightHeavyCustomsSize++;
                                  break;
                   case 5:          heavyCustoms[featherCustomsSize]=theName;
                                  heavyFighters = new JList(heavyCustoms);
                                  heavyCustomsSize++;
                                  break;
                   default:     System.out.println("Not Added");
                                  break;
         }

    Awww, its nice that DB has someone to comeback and carry on a discussion.....long after its over.
    The problem here seems to be your lack of understanding between what a teacher or what an 'instructor' is.
    From the way you speak, an instructor appears to be someone who is technically skilled in both coding and teaching Java as a programming language, designed for people who wish to code in Java.
    A Teacher is someone who must deliver a wide range of subject knowledge to a wide range of abilities, including those who were unable to pass High-School exams. They are responsible for pitching the subject at the correct level for the student, whilst also teaching towards passing the exam, and ultimately gaining a qualification.
    The computing course i am currently teaching does not require OOP, but as Java is the language i was taught at University, and is still often used in our University's, I chose it. I don't pretend to be the best programmer in the world. But I do know that I am teaching the pupils the correct basics, at a higher level than is probably required, to give them the right approach at university. also, this is whilst teaching a large amount of theory.
    Whether you agree, or disagree, matters not to me as I think you would be unfamilier with the specification I am currently teaching to, or what area's of study need to be taught. The exam board appears happy, as do past students who are now well into their university course, as did my marker when i achieved my degree.
    The code posted in the OP (as stated earlier) had nothing to do with displaying my coding abilities, nor did it display the technique's I use when teaching students. It was a small sample of a program which included a JList which was not displaying properly. I tried to include the whole code but it was too big, therefore it was cut down.
    It was a work in progress which i now have working. So now i can look at it again in terms of programming structure. It appears I have made a mistake asking for assistance on here, as instead I got a lecture, with very little insight on your part as to my situation or the nature of the problem/solution.
    At the end of the day, each to his/her own opinion. What I will say is that when someone requests help, positive feedback/criticism is well recieved along with instructions/guidance on how the problem can be solved. I feel that I received none of this on here, but this is what I will always provide to the students I teach.
    Not everyone is a full-time Java programmer or has the time to hit the highest expectations.

  • Display PDF in JSP using a content selector

    Hello,
    We are running on WLP 8.1 sp4. We have documents (Word and PDF) stored in the Weblogic Portal content management system. We have made several tries, but are unsuccessful in rendering a PDF inside a JSP using Content Selector tags. We can get a link to display and other properties of the content type, but we have not been able to show the actual binary property of the PDF. Has anyone climbed this mountain before, any help will be greatly appreciated!
    Rob
    The following displays links to the documents, but not the actual document.
    <pz:contentSelector rule="novel_flu_db_archived_reports"
    id="fluArchiveQuery" />
    <utility:notNull item="<%=fluArchiveQuery%>">
    <utility:forEachInArray array="<%=fluArchiveQuery%>" id="docA" >
    <cm:getProperty id="docA" name="file" conversionType="html" />
    <ad:render id="docA" />
    </utility:forEachInArray>
    </utility:notNull>

    Thank you for the response.
    Option 1 - would be great, but I am having problems getting this to work (see thread "Problem accessing a file stored in the CMS from link on JSP")
    Option 2 - I need to look into, as we need to be compliant with Accessibility standards and I can't remember if IFrames pose any problems for screen readers.
    Option 3 - introduces an additional step to the work flow, we would like to avoid extra work (if possible)
    In looking through the archives, there was mention of a "stand alone" JSP which was not under a Portlet or the Portal. The PDF was displayed in the stand alone JSP where the mime type was altered to PDF. Would this be an option?
    -Rob

  • How to display PDF in JSP using Iframe

    Hi All,
    I am using Struts 2. I am building my file in ActionClass with seperate Method like getGeneratedPDF() in which, I am setting header of response and writing into PDF.
    This method will be called from JSP by this way
    s:property value="getGeneratedPDF()" />
    But It displayed Junk Characters , and this PDF is not static (already Generated). It is generated and build on Fly.
    I have 2 questions 1 -- How to display PDF in JSP in proper way without Junk Character in it?
    questions 2 -- How to display it in Iframe?
    Please help me , If you know the solution.
    Thanks in Advance,
    Jimmy

    jamy_26 wrote:
    But It displayed Junk Characters , and this PDF is not static (already Generated). It is generated and build on Fly.A PDF file is a binary file, not a text file, and you're trying to display it as String. Of course you would get "junk characters". Have you ever tried opening a binary file (pdf, doc, jpg, xls, etc) using a text editor like Notepad?
    I have 2 questions 1 -- How to display PDF in JSP in proper way without Junk Character in it?Display it as binary stream, not as text stream. You can display it standalone, just let the link/form/addressbar URL point to some Servlet which writes the InputStream of the PDF file to the OutputStream of the response, along with a correct set of response headers (at least content-type, content-disposition and content-length), so that the browser can open it in the correct application (which is usually Acrobat Reader). If you want to embed the PDF file in a JSP, then one of the ways is indeed using the HTML <iframe> tag.
    questions 2 -- How to display it in Iframe? Just let the iframe URL point to the aforementioned Servlet.
    You can find here an example of a generic file servlet, you may find it useful to get the idea how to do it: [http://balusc.blogspot.com/2007/07/fileservlet.html].

  • How to include HTML file in JSP using HTML elements or Javascript?

    Hi,
    I have around 15000 static html files one for each item which we display each upon invoking an item.The HTML file should be part of a JSP file.
    Please note that the name of the HTML file is determined dynamically
    Placing all the HTML files within the web application does not give us good performance so i would like to put all of them in the webserver.
    I am not able to include the file in the JSP using the jsp:include attribute if i place the HTML files in the webserver ,
    in order to do that i think should use either HTML element or javascript to include the HTML in the JSP.is there any alternative to <Jsp:include>
    Does anyone have an idea how to include the HTML file and take advan tage of webserver?
    Any ideas are appreciated

    What you need to do is simply read the HTML file from the disk and dump it out to the outputstream. It really is that simple.
    There's no reason you need to include all 15000 files in the actual WAR, you can place those files any place handy that is easy for the application to see (in another directory, or accessible from a file server if you have multiple front ends).
    Then, just write a utiility function that takes the output stream (i.e. the 'out' JSP variable), and the file name, read the file, and write it to the stream.
    If you start noticing performance issues, then you can try doing some caching, but truth is your OS should be doing that for you.
    But, truth be told that's the only practical way to do it.
    Another solution would be to use JavaScriipt and XMLHttpRequest (i.e "AJAX") to load the file at the client side, and simply replace a tag with the results.
    That's also pretty trivial to write, any web site talking about AJAX should give you hint there.
    Of course, that won't work for folks who have JavaScript turned off, or some other incompatible browser, whereas the server side solution obviously works everywhere.

Maybe you are looking for