Using java.io.* in JSPs

What are the minimum requirements (Oracle user access permissions, Solaris file system permissions, etc.) for reading files through java.io in a JSP in Oracle 8.1.6? My code can read a local file when deployed as a standalone app on NT (using thin driver), but fails when deployed as a JSP and tries to read a file local to the Oracle server. Thanks in advance for any help you can provide.

Use the Java Developer's Guide for more info on privileges/roles to be granted.
javasyspriv is a role that gets created when Oracle 8i is installed with java. You should be able to grant it like any other role :
grant javasyspriv to <<user>>;

Similar Messages

  • Using java bean with jsp

    hello friends,
    i'm new to jsp. i want to create an html form that accepts username and a value from four radio buttons and display back the entered name and checked radio button's value using java bean.
    i use the <jsp:setProperty id="" property="*"> method. i don't know how to access the radio buttons value from the html.
    also when i use an additional field other than username the jsp page is showing error.
    Please give me the correct method to use java bean with jsp in this circumstance.
    thank you.

    thank you, but i have a problem left. the case is like this.
    i got the jsp and bean worked fine when i have a sinle input text field.
    but when i added a second text field i recieved the following error.
    javax.servlet.ServletException: basket.newbean.getUserPass()Ljava/lang/String;
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.newform.process_jsp._jspService(process_jsp.java:69)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    where userPass is the new form element. I have made the subsequent chanes in my bean program and jsp file.
    pls hlp.

  • What's the difference between using java directly in JSP and java bean

    What is the difference if I use java code directly in JSP or use java bean in JSP?
    Which class to use for receiving the passed parameter from html or java script? Any difference for java code and java bean in the way receiving the passed data?
    How can I pass string from jsp to html or java script?

    1 Cleaner pages
    2 you have to write the class and use set and get methods
    3 What do you mean when saying passing string from jsp to html??, do you mean the value you can use <%=variablename%>

  • Using java beans in jsp using tomcat

    hi i have made a form to enter user first name and last anme with html and then i have made a value javabean in which i want to store the information filled bu user. i want to display the information stored in java bean in jsp page i have made the full application and i have made class file of java bean as well as jsp file but when i try to run this web application in tomcat i am getting class not found exception.
    could anybody tell me that where i should store the bean class in tomcat and do i need to make any package in which i have to place my java bean file plz tell me complete procedure along with code if possible

    whew thats a lot of questions... All of this is pretty basic stuff. I would recommend you take a look at the web services tutorial: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
    lets see.
    Starting a package name with com is just a generic standard which is followed.
    It is most correct when creating commercial packages to create packages like com.companyName.project
    http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html
    You should not need a page import directive unless you are using classes in scriptlets: ie <% %> tags in your JSP. Your jsp:useBean tag will automatically import necessary classes - you don't need to import classes for beans specifically
    <jsp:useBean id="myClass" scope="session" class="com.myPackage" />
    Your directory structure should be something like this
    webApplicationRootDirectory
    - page1.html
    - page2.html
    - page3.jsp
    - page4.jsp
    - WEB-INF
         - web.xml
         - classes
           - com
             - myPackage
               - myClass.classerrrm. Thats about it I think.

  • In Struts is it possible to use java code  in jsp?

    in Struts Tag Program in jsp pages is it efficient to use java code? Please explain?

    No issues.. you can use java code... in jsp struts
    based framework..
    SJYou can use Java code as scriptlets in any JSP, but that doesn't mean there are no issues.
    I would say it's a bad idea for the following reasons:
    (1) Scriptlet code is difficult to read when mingled with HTML
    (2) You can't unit test scriptlet code
    (3) It increases the chance that business logic will leak into pages where it doesn't belong.
    Better to use a well-proven tag library like JSTL or the Struts taglibs and keep all scriptlets out of your JSPs.
    %

  • Problem in Using Java Bean in JSP

    Hi,
    I have a bean called BankAccount.....I tried to use it in a jsp file called Usebean.jsp like this <jsp:useBean id="BA" class="BankAccount" scope="application" /> I tried in both tomcat and j2ee1.3 server... but when i run the jsp file i get an error saying..... Class.org.apache.jsp.BankAccount not found...... But i have put the class file properly inse classes folder.....
    Can anyone help me soon..... i am new to JSP........
    Thanks,
    Akshatha

    Well u need to have your class in a package
    like mypackage.BankAccount
    and put your class in classes/mypackage
    <jsp:useBean id="BA" class="mypackage.BankAccount" scope="application" />

  • Using java files with JSP

    Ok, so im pretty new to this JSP lark and have a question.
    I have Java Classes resting in .java files, i need to know how
    do i link these files to my .jsp page so that the classes/variable etc.
    declared with the java files are recognised when they are come
    across in the .jsp file.
    I dont know if I have explained that properly.

    Just include this statement at the top of your jsp:
    <%@page import="yourpackage.yourclass"%>
    The .java files should of course be compiled into .class files prior to using (and you don't include the extension when importing).

  • Using Java Bean in JSP to show database record

    I have links in my Tomcat container that if someone clicks on a specific link it should go to a Record page (Show.jsp) with all the values associated with a record from a database.
    For example if someone clicks on a specific link like this:
    LinkExample
    it would take you to a jsp with database info for someone named Jones and show you his info:
    Lastname = Jones
    Firstname = Mike
    City = San Diego
    I would like to do this using a Java helper class and bean so I dont have any database connection or Java code in my JSP.
    I created Java class file that has Database connection that works with a Java bean. I just dont know how to get the Show.jsp to work with the Java Bean and Java helper class file.
    Here is what I have for Show.jsp and this is the part I have been working on the longest but cant get it to work because it doesnt seem to work with the database:<jsp:useBean id="user" class="num.UserDB"/>
    //do I call getUser(lastname) here and if so how?
    <jsp:setProperty name="user" property="*"/>
    Last Name: <jsp:getProperty name="user" property="lastname"/><BR>
    First Name: <jsp:getProperty name="user" property="firstname"/><BR>
    City: <jsp:getProperty name="user" property="city"/><BR>My Java Helper class that compiles and connects to database:
    package num;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import num.User;
    public class UserDB
    public User getUser(String lastname)
    User user = new User();     
            try          
         Class.forName...//database connection stuff here
        ResultSet results = stmt.executeQuery("SELECT * from user where lastname = '" + lastname + "'");
         if(results.next() == true)
         results.next();
         user.setLastname(results.getString("lastname"));
         user.setFirstname(results.getString("firstname"));
            user.setFirstname(results.getString("city"));
         catch(Exception e)          
                   System.out.println("Exception...");               
       return user;
    }My Java Bean that compiles here:
    package num;
    public class User
      private String firstname;
      private String lastname;
    private String city;
      public User()
         //no arg constructor
      public User(String firstname, String lastname, String city)
           this.lastname = lastname;
              this.firstname = firstname;
              this.city = city;
      public String getLastname()
              return lastname;
      public void setLastname(String lastname)
         this.lastname = lastname;
      //more bean methods for all fields here
     

    Sorry if I wasnt specific enough. I have a link that passes a value (field that is passed is called lastname) to a JSP where I want to show record info for that value that is passed.
    My question is how do I show the database record info on Show.jsp for the lastname field value of Jones where I want to use a Java Bean and Database helper class in Show.jsp
    Here is the message I get when I hit the link (LinkExample) and it goes to Show.jsp:
    org.apache.jasper.JasperException: Cannot find any information on property 'lastname' in a bean of type 'num.UserDB'
    .....My UserDB class:
    public class UserDB
    public User getUser(String lastname)
    User user = new User();     
            try          
         Class.forName("org.gjt.mm.mysql.Driver");
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/dbconnone?user=smitherson&password=abcdefg");
        Statement stmt = conn.createStatement();
        ResultSet results = stmt.executeQuery("SELECT * from user where lastname = '" + lastname + "'");
         if(results.next() == true)
         results.next();
         user.setLastname(results.getString("lastname"));
         user.setFirstname(results.getString("firstname"));
                         user.city(results.getString("city"));
         catch(Exception e)          
             System.out.println("Exception..." + e);          
       return user;
    }Bean class:
    package num;
    public class User
      private String firstname;
      private String lastname;
      private String city;
      public User()
         //no arg constructor
      public User(String firstname, String lastname, Sting city)
          this.firstname = firstname;
           this.lastname = lastname;
    this.city = city;
      public String getFirstname()
              return firstname;
      public void setFirstname(String firstname)
         this.firstname = firstname;
      public String getLastname()
              return lastname;
      public void setLastname(String lastname)
         this.lastname = lastname;
      public String getCity()
              return city;
      public void setCity(String city)
         this.city = city;
      

  • Using java classes in jsp

    hi everybody
    I'm using Apache Tomcat 5.5.7 and I want to develop very very simple jsp-files.
    I have a java class file called MyClass.
    When I start the jsp file with the code line
    MyClass class = new MyClass();
    I get this error: MyClass cannot be resolved or is not a type
    As I know the hierachy must be the following:
    ProjectRoot/WEB-INF/classes/MyClass.class
    ProjectRoot/start.jsp
    In the java class the Constructor is empty... so I cannot see why this should make a problem. I also tried to put the class file into a package and import the package. I had the same error then.
    I read something about the web.xml file which should be in the WEB-INF directory.
    will this help me... and if yes, what do I need to write into it?
    If I did any mistake I would be happy if somebody could give me a hint.
    Cheers
    alex

    1 - The class needs to be in a package. eg com.mypackage.MyClass. This file lives in /WEB-INF/classes/com/mypackage/MyClass.class
    2 - in your jsp you include the line
    <%@ page import="com.mypackage.MyClass" %>
    <%
    MyClass myClass = new MyClass();
    %>
    3 - Also note that "class" is a reserved word in java, and can not be used as a variable identifier.
    4 - Yes you most probably should have a web.xml file in the WEB-INF directory.
    Look under the webbapps/ROOT/WEB-INF for a basic example.
    Cheers,
    evnafets

  • Need an information using java.sql in jsp

    I found that there is a 'dataset' like architecture in .NET, is there any 'dataset' like substance in our java, if it is means can you give me some ideas for using it in jsp, give me some example for saving a record in the mysql database. very urgent please,

    KIRUPA_SHANKAR wrote:
    I found that there is a 'dataset' like architecture in .NET, is there any 'dataset' like substance in our java, if it is means can you give me some ideas for using it in jsp, give me some example for saving a record in the mysql database. Shouldn't be doing database stuff in JSPs. Use JSTL and its <sql> tags if you must.
    RowSet might be close. I don't write .NET.
    very urgent please,Not to me.
    %

  • Opening a new Broswer Window using Java code inside JSP

    Dear Fellow Java Developers:
    I have written a JSP that presents information about a particular item. I want to give an option to the customer to click on the picture of the item to get a larger view. However, I don't want the browser window that opens to have the usual buttons and menubar at the top like a typical browser window, I just want it to be a window with a large image of the item. A good example of this is on the following website:
    http://www.eddiebauer.com/eb/product.asp?product_id=24701&nv=2|21472|9|32&lview=&cm_cg=&tid=&c=&sc=&lp=w1i005
    Click on the picture of the shirt on this page and you'll see what I am talking about. How is this accomplished using a Java scriplet? I have checked the source code for the above site, as well as others, and they all achieve this using JavaScript. Is there a way of accomplishing this using pure Java and/or HTML?
    Just wondering.
    Thanks in advance to everyone that replies.
    Sincerely;
    Fayyaz

    you seem to miss the client/server side setup. Your java is executing on the SERVER and it processes a request which in turn sends pure HTML and javascript to the client. What you want to do has to be done on the CLIENT, so JavaScript is the only option.

  • How to write to log files using java files from JSP

    Anybody knows different options in writing to log files using JSP?

    Do you have an example?in the init() method of the servlet put the following
            FileOutputStream out = new FileOutputStream("your-log-file");
            PrintStream ps = new PrintStream(out);
            System.setOut(ps);
            System.setErr(ps);load the servlet on startup using <load-on-startup> in web.xml

  • 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

  • Problem in using java bean with jsp

    Hi,
    This is my code and i get this error. Not able to trace the mistake.
    bean.html
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Fname</title>
    </head>
    <body>
    <form method="POST" action="http://localhost:8080/beanjsp.jsp">
         <p>Fname: <input type="text" name="T1" size="20"></p>
         <p>Lname: <input type="text" name="T2" size="20"></p>
         <p> </p>
         <p> </p>
         <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>
    </body>
    </html>
    beanjsp.jsp
    <jsp:useBean id="bean" class="beans.FirstBean" scope="application" />
    <jsp:setProperty name="bean" property="fname" param="T1" />
    <jsp:setProperty name="bean" property="lname" param="T2" />
    THE FIRST NAME IS <%=bean.getFname() %>
    THE LAST NAME IS <%=bean.getLname() %>
    FirstBean.java
    //CREATING A BEAN
    package beans;
    import java.io.*;
    public class FirstBean
         private String fname;
         private String lname;
         FirstBean()
              fname="";
              lname="";
         public void setFname(String fn)
              fname=fn;
         public void setLname(String ln)
              lname=ln;
         public String getFname()
              return fname;
    public String getLname()
              return lname;
    error report
    org.apache.jasper.JasperException: /beanjsp.jsp(2,0) The value for the useBean class attribute beans.FirstBean is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1223)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3270)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)I have placed the beans package folder containing FirstBean.class inside classes folder of ROOT directory.
    I don't know what s wrong with my code :( ... Plz help asap.
    Thanks,
    Akshatha

    I have placed the beans package folder containing FirstBean.class >inside classes folder of ROOT directory.Place it in the WEB-INF/classes folder
    ram.

  • How can i use JAVA BEAN and JSP?

    well, i have developed all my web apps by using pure JSP only, i know this sucks, but i dont know how to start on using beans... what directory should i put them into... etc... what are the good programminmg practices/standards/techniques when incorporating beans in jsp???

    Standards are pretty loose, but generally, Beans hold a lot of the backend logic for your JSP. This can include data validation before entering into the database, database inserts, queries, data manipulation. The JSP should really only contain code that will retrieve the data from the bean and appropriately output it.
    As far as using them, you can use the <jsp:useBean> tag in your JSP. As long as the bean is stored somewhere that your classpath points to, you're all set. From then on, you can use it like any other object in your JSP.

  • Using java beans in jsp

    Hi, I need to do this, can any one help me.
    In the signup form, i have some text frields like this
    HTML
    <form action=http://localhost:8080/servlet/Signup.jsp">
    <input type=text name=name>
    <input type=text name=phone>
    <input type=submit value="Submit">
    </form>
    JAVASP
    req.getParameter("name");
    req.getParameter("phone");
    i am doing some validation here like if the user name exists in the database i am diverting him to the html page like this
    rs = st.executeUpdate("select * from regi where user="+name+"");
    if(rs.next())
    here i need to call the html page in the from of a bean and with the old values intact to it
    else
    insert into regi values('"+name+"','"+phone+"')
    this is how i am doin my html in the form of a bean
    <%!
    public void beans()
    %>
    <form action=http://localhost:8080/servlet/Signup.jsp">
    <input type=text name=name value=<%=name%>>
    <input type=text name=phone value=<%=phone%>>
    <input type=submit value="Submit">
    </form>
    <%!
    %>
    but this is giving me error, can any one help me please?
    Thanks
    Uma

    Hai Uma,
    I read ur code like this.
    <%!
    public void beans()
    %>
    <form action=http://localhost:8080/servlet/Signup.jsp">
    I think here is the mistake. <%! %> - for declaring variables. But for writting codes we have to use <% %> tags only. Can u try the same program by removing "{" in this tags or remove "!" from tag...
    I hope this may helpful to u to solve ur problem
    With Regards
    Siva

Maybe you are looking for

  • Saving Stuff In A Folder...

    Lets say I have three people using TC and they each have a folder on the drive that they drop things in... can those folders be locked so that other can access the contents? Thanks!

  • Getting error in Bex

    Hi, I am getting the following error while doing any changes in a workbook in Bex analyzer: An error occured in the communication with BW server. Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION Symtex error in program CL_RSR_RRKO_PARTITIO

  • DVD Burn Question

    This question could very easily have a common sense answer that I am overlooking at the moment... I made a copy of a DVD that contained a show. It burned successfully and will play if you manually open it from the DVD player. My questions is, how do

  • Unable to join the wifi network

    I am getting msg: unable to join the wifi, after I enter the passport

  • BT infinity & imac

    I'm trying to investigate why my speed is so slow on my imac(2011), when it used to be so much faster. I have download speeds of about 5MBps, up similar; this is connecting via wifi.  My ipad, sitting next to the imac, shows download speeds of 20, up