Regarding JSP,Struts

Hello , Pls reply Urgent ,
This is my code ,
struts-config.xml
<form-bean name="studentForm" type="com.ltc.forms.StudentForm"></form-bean>
<action path="/userAction" type="com.ltc.actions.StudentMaintananceAction" name="studentForm" scope="session" validate="true" input="/jsp/homePage.jsp" >
<forward name="success" path="resultSuccess"/>
<forward name="fail" path="resultFail"/>
<forward name="addPage" path="userAddPage"/>
<forward name="viewPage" path ="userViewPage"/>
</action>
StudentMaintananceAction
if(strBtnValue.equals("view"))
ArrayList viewList = sBean.viewStudentList();
sForm.setResults(viewList);
forward = mapping.findForward("viewPage");
StudentForm.java
---------------------------->
public class StudentForm extends ActionForm {
private String firstName = null;
private ArrayList results = null;
public String getFirstName() {
System.out.println("--- getFirstName --:"+firstName);
return firstName;
public void setFirstName(String firstName) {
this.firstName = firstName;
public ArrayList getResults() {
return results;
public void setResults(ArrayList results) {
this.results = results;
userView.jsp
---->
userView.jsp
<logic:present name="studentForm" property="results">
<% System.out.println(" -------- logic:present 1---:"+request.getAttribute("studentForm")); %>
<hr width="100%" size="1" noshade="true">
<bean:size id="size" name="studentForm" property="results"/>
<% System.out.println(" -------- bean:size ---"); %>
<logic:equal name="size" value="0">
<% System.out.println(" -------- bean:size 0---"); %>
<center><font color="red"><b>No Students Found</b></font></center>
</logic:equal>
<logic:greaterThan name="size" value="0">
<% System.out.println(" -------- bean:size >0---"); %>
<TABLE BORDER="1" >
<tr><th>Student ID</th><th>First Name</th><th>Last Name</th><th>Qualification</th>
<th>Technology</th>
</tr>
<logic:iterate id="resultId" name="studentForm" property="results">
<%System.out.println(" ----- JSP 1-----"); %>
<tr>
<%System.out.println(" ----- JSP 2-----"); %>
<td><bean:write name="resultId" property="firstName"/></td>
<%System.out.println(" ----- JSP 3-----"); %>
<td><bean:write name="resultId" property="lastName" /></td>
<%System.out.println(" ----- JSP 4-----"); %>
<td><bean:write name="resultId" property="qualification" /></td>
<%System.out.println(" ----- JSP 5-----"); %>
<td><bean:write name="resultId" property="technology"/></td>
<%System.out.println(" ----- JSP 6----"); %>
</tr>
</logic:iterate>
</TABLE>
</logic:greaterThan>
</logic:present>
This is the error I am facing ,
javax.servlet.ServletException: No getter method for property firstName of bean resultId.
Upto System.out.println(" ----- JSP 2-----"); Its coming ,
Pls send me solution urgently.
Regards,
Praveen

hi,
public String getFirstname() {
System.out.println("--- getFirstName --:"+firstName);
return firstName;
public void setFirstname(String firstName) {
this.firstName = firstName;
}now it will work,
use upper case letter after getX & setX, remaining you to follow in small case

Similar Messages

  • Frame issue in jsp/struts application

    I have a problem with jsp struts application .
    i have a jsp page which is inside a frame .
    The action class which receives the request from this page redirects the request to another jsp page.
    I want this new jsp page to be displayed without any frame , but it is getting displayed from inside the frame .
    can anybody help me out ...
    regards,               
    slam

    Possibly:
    1. Browser could be caching the page.
    2. If you use a proxy, the proxy may be caching the page.
    3. The page is not getting recompiled.

  • Non-ascii, jsp-struts, not reciveing the correct value in the server

    Hi,
    I am developing JSP-Struts based application using tomcat server. In JSP struts form, when I put nonascii charater in the text field or text area, on the server side I recived twice of that non-ascii character..
    for example, in the text field I entered following string:
    ------> This is text in tex field �&#131;
    On the server side, I get the following:
    ------> This is text in tex field �&#131;�&#131;
    Please notice, twice non ascii character.. :(
    I don't know how to resolve this.. Any help will be greatly appricated..
    Thanks,
    Ajay

    I changed the <form> in the jsp to div and its working fine. I do not need to have comments in JavaScript funcion() anymore. I don't know why that made the difference though? According to:
    http://www.w3schools.com/tags/tag_form.asp
    The <form> tag is used to create an HTML form for user input.
    The <form> element can contain one or more of the following form elements:
    <input>
    <textarea>
    <button>
    <select>
    <option>
    <optgroup>
    <fieldset>
    <label>
    An HTML form is used to pass data to a server.
    I do have <button> and also send the data - the value of checkboxes - to server. So I think it should also work with <form>.
    Please let me know if you have any idea. Thanks.

  • Tracking a separate Thread  - java/jsp/struts

    Hi all,
    My project is a webapplication using java/jsp/struts. My requirement is to write bulk data to a file, which i want to run as a separate thread. Since it runs as a separate thread the control comes back to UI (userInterface) page. On subsequent request from UI page by the user i want to check whether the thread process is completed or not , so that i can read from the file. Is it possible to simultaneously read from the file when the thread is in the process of writing data to the file. If so any idea on how to implement this functionality in java?
    How to keep track of the separate thread (whether it is completed or not) in java?
    Is it possible to read from the file when the thread is writing to the file in java?
    Thanks is advance.

    dangerous wrote:
    How to keep track of the separate thread (whether it is completed or not) in java?Thread#join().
    As you're already asking this trival question, I highly recommend you to read the Concurrency Tutorial here at Sun.com. Google can find it.
    Is it possible to read from the file when the thread is writing to the file in java?Not with java.io. You can use the java.nio API for that. You can also read/write it in memory (as a byte[] or a ByteArrayInputStream/OutputStream property) and if it is finished then write it to disk.

  • Deploy BC4J/JSP-Struts to IAS

    HI,
    I'm trying to deploy a BC4J/JSP-Struts application to IAS. This application was developed with JDeveloper 9.0.3.
    I can deploy this application to a Standalone OC4J (delivered with JDeveloper 9.0.3) on Windows2000 without problem.
    Then I want to deploy this application on Oracle9iAS 9.0.2. For this I create an .EAR file with JDeveloper and I start the OC4J Administrator tools from Oracle9iAS and deploy my application.
    I start the application with
    http://erbium.int.imd.ch:7778/InvoicesInterface/main.jsp?user=x-XxX
    and I become the menu without Problem.
    Then I click on the link
    http://erbium.int.imd.ch:7778/InvoicesInterface/VInvoiceUsersView1_Browse.do?user=x-XxX
    and I become following :
    HTTP 500 Internal server error
    The page cannot be displayed
    Did you have any Ideas ?
    Thanks Yves
    Configuration:
    - Oracle9iAS (9.0.2) on Solaris
    - JDeveloper9.0.3

    Yves -
    I am not able to pinpoint the exact error you are having but here are some obervations
    a) You are going backwards in versions of OC4J when you deploy to 9iAS 902. If you are using JDev 903, then it is running with a local version of OC4J 903. When you are deploying to 9iAS 902, it's a earlier release of OC4J, so there may be an issue there. There is a 9iAS 903 version available from OTN that would be better to use in this case.
    b) Is the struts framework packaged as part of the EAR file you are deploying? i'm not familiar with how BC4J and Struts apps are packaged from JDeveloper, but this is something to check on for sure. The local OC4J running inside of JDeveloper may have the Struts libs configured at the server level.
    c) You might want to try and change the show-friendly-error-messages (or something like that) property inside of IE (if you are using it) so that it will display the stack trace the server might be sending. this may be of help to further locate the source of the problem (ClassNotFoundException, etc.).
    -steve-

  • Learning JSP/Struts with JDeveloper

    Hi. We have an older version of Java on our Unix production web server (1.4.2_12-b03) and it'll be a year before we upgrade it and use JSF. In the meantime, I'm looking at learning Struts and JSP. Can you point me to a few tutorials specific to JDeveloper for JSP/Struts? Most of the tutorials now are for ADF/JSF -- which we can't use yet. Thanks.

    Just to clarify - JSF can run on OAS 10.1.2 (that supports J2EE 1.3 and uses JDK 1.4).
    See: http://download.oracle.com/docs/html/B25947_01/deployment_topics006.htm#CIHCGGDF
    So this shouldn't be a reason for you not to use JSF and JDeveloper 10.1.3.
    That said if you want to learn Struts try following the archive links on the various JDeveloper tutorials/demos pages to the demos from the 9.0.5/10.1.2 days.

  • Dynamic Tree Creation using JSP, Struts framework

    I urgently require tips/information/code snippet for creating a Dynamic Tree structure.
    Tree is the hierarchical folder structure that we see in windows operating system.
    Dynamic tree in the sense that all nodes shall be populated from database & a radio button shall be present at each node that can be selected & submitted to form.
    Tree should be done using JSP (& if required Javascript).
    I am using Struts framework .
    [email protected]

    u need to know quite a few java technologies to make archieve your dream.
    JDBC, dynamic array and JSP.
    after reading tutorial regarding to these 3 materials, you should be able to get your job done.

  • Reading Byte [] in JSP - Struts

    Hi,
              I am storing PDF files as BLOB object in Oracle 9i Database.
              In my struts action class I am reading the file and converting it into byte [].
              I am storing this value in the session as an object and while reading in the JSP,I am getting only null.
              But when I check the size of the byte [], it says 7,which is the actual length.
              How to read the byte [] and put it session?
              Any suggestions.
              Regards,
              Ram

    Hi Kris,
              Thank you for your inputs.
              I have tried this option also.
              Still I am getting the same issue like the "File does not begin with %PDF-".
              Actually I am getting the byte[] in my DAO class and passing that value to the action class by way of list.
              In my action class I am doing the below code.
              List lstResult = new ArrayList();
              byte[] byteArray = (byte[]) lstResult.get(0);
                             smCat.debug("DailySalesReportAction - b4 byte array");
                             // write data to output stream of response object
                             try {
                                  st = objHttpResponse.getOutputStream();
                                  smCat.debug("DailySalesReportAction - inside try");
                                  objHttpResponse.setContentType("application/pdf");
                                  objHttpResponse.setContentLength(byteArray.length);     
                                  objHttpResponse.setHeader("Content-Disposition","inline");
                                  st.write(byteArray);
                                  st.flush();
                                  st.close();
                             } catch (IOException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
              My DAO looks like this.
              public byte[] executeBlobQuery(String strQuery) {
                        java.sql.Connection vendorConn = null;
                             Blob blobResult = null;
                             int lob_length = 0;
                             BufferedInputStream bufferedInStream = null;
                             java.io.OutputStream os = null;
                             byte[] byteBuffer = null;
                             smCat.debug("Entering in executeBlobQuery DAO***************> ");
                             try {
                                  try {
                                       mConnection = getConnection();
                                  } catch (Exception e) {
                                       smCat.error(e.getMessage());
                                  // Create a static JDBC statement
                                  Statement m_stmt = mConnection.createStatement();
                                  mConnection.setAutoCommit(false);
                                  m_stmt.setFetchSize(10000);
                                                      ResultSet m_rs = m_stmt.executeQuery(strQuery);
                                  // Increment the result set
                                  if(m_rs.next()){
                                  smCat.debug("strQuery "+strQuery);
                                  //blobResult = ((OracleResultSet) m_rs).getBLOB("REPORT");
                                  //blobResult = m_rs.getBlob("REPORT");
                                  //byteBuffer = m_rs.getBytes("REPORT");
                                  //System.out.println("Length is --> "+byteBuffer.length);
                                  os = ((OracleThinBlob)blobResult).getBinaryOutputStream();
                                  smCat.debug("Blob Retrived ");
                                  //image = (oracle.sql.BLOB)m_rs.getBlob(1);
                                  lob_length = (int) blobResult.length();
                                  smCat.debug("Value is --> " + lob_length);
                                  byteBuffer = new byte[lob_length];
                                                 int length = -1;
                                                 os.write(byteBuffer);
                                  smCat.debug("Value of byteBuffer --> " + byteBuffer.length);
                                                 os.flush();
                                  mConnection.commit();
                                                 os.close();
                                  bufferedInStream =
                                       new BufferedInputStream(blobResult.getBinaryStream());
                                  byteBuffer = new byte[lob_length];
                                  bufferedInStream.read(byteBuffer, 0, lob_length);
                                  bufferedInStream.close();
                             } catch (SQLException sqe) {
                                  smCat.error(sqe.getMessage());
                             catch (IOException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
              Ram

  • Jsp, struts, problem in session invalidation

    Hello,
    Though have seen many topics here related to this, still cudn't get a proper solution. I'm having a struts application with many jsp's. have used session.invalidate for expiring sessions. Now the problem is my jsp have both button specific action and <html:link> forwards. tried including "response.setHeader("Cache-Control", "no-cache"); //Forces caches to obtain a new copy of the page from the origin server
    response.setHeader("Cache-Control", "no-store"); //Directs caches not to store the page under any circumstance
    response.setDateHeader("Expires", 0); //Causes the proxy cache to see the page as "stale"
    response.setHeader("Pragma", "no-cache"); //HTTP 1.0 backward compatibility"
    got it from one of the topics here only.
    Now when i logout from any of my jsp and press back button of browser, the jsp's having struts specific action(http://...../xyz/edituser.do)works fine but forward specific jsp's(http://...../xyz/edit.jsp) is not redirecting to my login page(page not found error :- /xyz/edit.jsp). Also what if i press the browser back button more thn once????? weather this thing works on client side???at the moment in my application even the action specific logout is not working.........how can i solve this problem elegantly?????

    I faced same problem.
    I used below code.
    This code in every Authorized page.
    <%
    response.setHeader("Cache-Control","no-cache");
    response.setHeader("Cache-Control","no-store");
    response.setDateHeader("Expires", 0);
    response.setHeader("Pragma","no-cache");
    %>
    <%
    String username=(String) session.getAttribute("user");
    if(null==username)
         response.sendRedirect("../jsp-modLogin/login.jsp");
    }This code in logout page
    <%
    session.removeAttribute("user");
    session.invalidate();
    response.sendRedirect("../index.jsp");
    %>For me, It is working fine...
    Check it with ur code
    Regards
    Ramesh

  • Questions regarding jsp file download from blob

    Hi developers, i'm doing jsp file download from a blob column in DB2 using struts,
    1) How do i design the jsp page such that the page will show perhaps a hyperlink for me to download the file?
    2) What about struts-config.xml? Do i need to modify any mappings there?
    It would be great if some kind developers were to provide some sample codes for me. Thanks alot. Your effort is kindly appreciated.

    http://kr.forums.oracle.com/forums/thread.jspa?threadID=1982213 - looks similar, you may need to change contentType as per use case

  • How to putput a property of an object in session? (jsp/struts)

    Guys,
    I have an object (myGroup) that consist of 2 properties: groupName and groupTitle. The object is in a session called group_session.
    On my jsp page, I would like to output the property groupName on the text field associated with the groupName:
                   <html:text      property="name"
                                                   value=???????????????
                                  size="45"
                                  maxlength="60" />
                                  <html:errors property="name" />Q: how can I output the value of the groupName in the value section?
    thanks

    Hi
    you can try something like this....
    <input type="text" name="any" property="<bean:write
    name="myGroup" property="groupName "
    scope="session"/> " >
    This snippet is closer to JSP coding rather than struts. Leverage the capabilities of struts by setting the values in ActionServlet instead.
    <html:text property="name" size="45"  maxlength="60" />                    -Rohit
    By the way why did you add this tag
    <html:errors property="name" /> ??
    Message was edited by:
    RohitKumar

  • How to instantiate object in JSP/STRUTS page?

    I worked through the STRUTS tutorial (http://rzserv2.fhnon.de/~lg002556/struts/Doku.html) but I get errors when I try to instantiate an object of a class that is in my WEB-INF/classes directory:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 14 in the jsp file: /BookSerialize.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    D:\Programme\jakarta-tomcat-4.1.12\work\Standalone\localhost\strutsdemo\BookSerialize_jsp.java:86: cannot resolve symbol
    symbol : class Book
    location: class org.apache.jsp.BookSerialize_jsp
    Book book = new Book();
    ^
    The Book.class (and other classes) is in the WEB-INF/classes directory. The BookSerialize.jsp is here:
    <%@ page language="java" import="java.beans.XMLEncoder, java.beans.XMLDecoder, java.io.*"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html:html locale="true">
    <head>
    <html:base/>
    <title><bean:message key="index.title"/></title>
    </head>
    <body bgcolor="white">
    <h2>Book Serialization</h2>
    <%
    Book book = new Book();
    book.setTitle("A great Book about Struts");
    book.setPages(100);
    out.println("<member>First Title: " + book.getTitle() + "</member>");
    try {
    XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream("/Sample.xml")));
    encoder.writeObject(book);
    encoder.close();
    } catch(Exception ex) {
    out.println(ex);
    book.setTitle("A great Book about Struts, Second Edition");
    out.println("<member>Second Title: " + book.getTitle() + "</member>");
    try {
    XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(new FileInputStream("/Sample.xml")));
    book = (Book) decoder.readObject();
    decoder.close();
    } catch(Exception ex) {
    out.println("<h1>" + ex + "</h1>");
    out.println("<member>Third Title: " + book.getTitle() + "</member>");
    %>
    </body>
    </html:html>
    I also get the same error when deploying and (trying to) run on the J2EE 1.3.1 server.
    So far, I just used JSP pages working with beans (usebean tag). Is it possible at all to just do a
    MyClass myObject = new MyClass();
    within a JSP page, if MyClass.class is in the WEB-INF/classes of the web application?
    Is there any kind of import missing? Book.class is in the default package, so i can't state it in the page directive/import parameter of the JSP page...
    any advice?

    I think, I got it: you have to use package names for your classes and avoid the default package. After I used a package name, it was possible to instantiate the object ....

  • Oracle portal using JSF, JSP, Struts framework

    Hi ,
    Can anyone tell me how to build an oracle portal using JSF,Jsp and Struts Framework.
    Also please provide any manual or documentation for developing oracle portal.
    Thanks in Advance,
    Raghav

    At present, i think the best thing to do is to look at the example provided with the struts-faces integration taglib. I don't know any documentation about it.
    http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/

  • Newbie to JSP/Struts: Where to get started

    I would like to begin experimenting with JSP and the struts framework. I'm a java newbie but a relatively quick learner.
    First, what products do I need to use struts/JSP ?
    I have 9iAS standard edition release 1.0.2.1 and an oracle database std edition without the JVM installed. Do I need the JVM in the database ? Can JSP use a JVM outside the database ? Do I need enterprise edition ?
    Do I need Jdevelopper 9i or can I learn to use JSP with simple tools (HTML editor) first ?
    Does struts need JSP 2.0 spec or the JSP 1.1 that comes with iAS 1.0.2.1 is OK ? Is JSP 2.0 = JSP 1.2 (Like J2EE = JDK1.2 and up) There is a lot of version/naming confusion going on in java, you got any site that can help me untangle this mess ?
    Thanks a lot
    You can reply to [email protected]

    Thanks for your response.
    We actually use oracle 8.1.7 and 9iAS (PL/SQL gateway and http server). We would like to jump on the Java Bandwagon before we are left in the dust. We first need to be able to understand a lot of technology/concepts/buzzwords.
    We started basic Java programming (Applications) but would prefer to get an idea of "The big picture".
    By that, I mean, we need to be able to understand/design/architect sound applications and be able to talk to the community and understand what they are saying. Right now, reading the media or forums is just a big bunch of buzzwords that are ever changing and we cannot get a grasp on it.
    We not only need to get aquainted with the concepts, but we also need to be able to determine wether product xyz fits in the architecture, etc...
    If you were to get a couple of good books to answer some questions, where would you begin ?
    Kind of questions we might have are:
    - What is the difference between Jserv and Tomcat ?
    - What excatly is tomcat ? A replacement for Jserv ?
    - Can Jserv be used as a container for struts apps or do you need tomcat ? If you need tomcat, does it come with some version of 9ias ?
    - What is a java web service ?
    - I read a lot about Enterprise Java Beans etc.. What are they, what are there purpose ? It seems like it is a standard, what are they used for ? If it is a standard, does this mean that If I buy a set of EJB from a vendor, it would offer the same beans as another vendor ? Is Oracle BC4J an implementation of EJB with added functionality ? Is it proprietary ?
    - Buzzwords everywhere: MVC, EJB, J2EE, BC4J etc.. What are the definitions.
    - Is oracle's java vision proprietary or are they really following the rest of the world ? For example, is BC4J compatible with EJB ?
    - What is a Framework
    - What exactly is JSP.
    - Can STRUTS be used to access an oracle database ? If so, what are the required components (I guess you need JDBC or SQLJ) but does the oracle database need to be java enabled ?
    - Even if you use oracle 9ias as an application server, can you use non-proprietary development methods/architectures/techniques that could be easily implemented somewhere else using another vendor's application server (Ex: Apache + Tomcat, WebSphere, etc...)
    - Struts seems to be an interesting thing. I see that it was developped to encourage code reuse and prevent everyone from reinventing the wheel. But I cannot understand what exactly a developper had to write before struts was there. I mean, there must be alternatives to strut, if so what is the purpose of the framework ?
    A lot of questions, but we need to understand the basics before we jump on the java bandwagon. If we wait, we'll be left in the dust and we need to keep current.
    Thanks in advance.

  • Plz help me regarding jsps

    Hi all,
    I have menu.jsp which is included in 100 jsp's
    in menu.jsp i have lots of db calls so each and evry action this menu is getting called so my application performence is getting decreasing so how can i include menu.jsp in all 100 jsps so i my application works faster and faster.., any suggetions are welcome
    Regards
    Rajani

    if you know the ans tell me or els dont make joke of
    itI wasn't making a joke, you quite clearly didn't bother reading my post. you just saw that I hadn't spoon-fed you code like you hoped, and moved on. this happens every single day. and since this is a free forum, I think I'll choose for myself what and who I reply to, and in what manner

Maybe you are looking for

  • Strip domain name in PEAP Authentication

    Is there ny chance to strip domain name (domain\username) in PEAP Authentication?

  • FS-PM Dump Error - OBJECTS_OBJREF_NOT_ASSIGNED_NO

    Hi Expert, I have installed FS-PM 5.1 on NW 731 of my PC. and I also installed the FS-PM relevant add-ons/latest SP. But, when I execute the Inquiry/Change/New Business Transaction in the FS-PM, I received the following error messages: Category      

  • OSS 650345 . Error : Enter Numeric Value

    Hi All, I had applied the OSS Note 650345. With this OSS Note we can Upload Data in Background for Transaction's KP06 & KP46. While using Excel Upload in KP06 Transaction to upload the data it is working fine. When I use the same file from Applicatio

  • Tethered Shooting with Nikon D7000 - when?

    I was quite surprised (as, it seems, have others) to discover that tethered shooting is not yet supported with the Nikon D7000 in the latest Lightroom 3.3 release. Has Adobe made any statements regarding the availability of this feature? Does anyone

  • BC4J Tester won't run with SunJCE provider enabled in JDev 903

    I have a working BC4J project that I can access via the Tester and via code in JDev 903. The Module is deployed in 'Local' mode. I go into <jdev_home>\jdk\jre\lib\security\java.security and add the following line: security.provider.3=com.sun.crypto.p