Read a property file value and display in jsp page

I need a solution for the below mentioned scenario,
I want to read a value from the property file in JSP page.
For Example, Let us have a property file called A.properties, in the file, we have a value, username = Sam.
I want to bring this value in the jsp page.
Please assist in this issue.
thanks in advance.

If you are using struts, then you have to first load the taglib like
<%@ taglib uri="/WEB-INF/strutsresources/struts-bean.tld" prefix="bean" %>and then access the particular property like
<bean:message key="welcome"/>Also, you have to define <message-resources> in struts-config. Though I am not into struts for year now, So, please confirm the code.

Similar Messages

  • How to retrieve data and display in JSP page

    hi,
    i am trying to retrieve data from SQL server 2000 and display in JSP Page. I have already place the codes of the retrieve in the bean file. I wanna ask is that how to display in the JSP page. If possible, can provide example codings for mi to reference?
    Thanks
    Regards,
    shixuan

    HI Tan ,
    I pressume that you wanted to make use of PDK, the code can go like this .
    <b><u>1) JAVA file</u></b>
    import com.sapportals.htmlb.DropdownListBox;
         import com.sapportals.htmlb.InputField;
         import com.sapportals.htmlb.event.Event;
         import com.sapportals.htmlb.page.DynPage;
         import com.sapportals.htmlb.page.PageException;
         import com.sapportals.portal.htmlb.page.JSPDynPage;
         import com.sapportals.portal.htmlb.page.PageProcessorComponent;
         import com.sapportals.portal.prt.component.IPortalComponentRequest;
         import com.sapportals.portal.prt.component.IPortalComponentSession;
         import com.sapportals.portal.prt.component.IPortalComponentContext;
         import java.sql.*;
         public class P_SAP_B_User extends PageProcessorComponent
         * Method          :           getPage()
         * Description      :                         
         * Input Parameters     :     None
         * Returns          :          Object of Class DynPage     
              public DynPage getPage()
                  return new P_SAP_B_UserDynPage();
                }     // end of dynPage()
                public static class P_SAP_B_UserDynPage extends JSPDynPage
                  /* Variable Declaration     */
                   /* Object of bean class P_SAP_B_CreateUser initialised to null */
                       private P_SAP_B_CreateUser createUserBean = null;
                  /* Flags for checking the occurance of Event & Error. */
                  private int iFlag=0;
                  private int iErrFlag=0;
                  /* Variables for storing the information
                          entered by user in each text field */
                  private String sFname;
                  private String sSname;
                  private String sAge;
                  private String sExp;
                  private String sSkill;
                  private String sUnit;
         * Method          :           doInitialization()
         * Description      :                         
         * Input Parameters     :     None
         * Returns          :          None
                  public void doInitialization()
                         IPortalComponentSession componentSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
                         Object o = componentSession.getValue("createUserBean");
                         if(o==null || !(o instanceof P_SAP_B_CreateUser))
                           createUserBean = new P_SAP_B_CreateUser();
                           componentSession.putValue("createUserBean",createUserBean);
                        }     // end of if
                         else
                             createUserBean = (P_SAP_B_CreateUser) o;
                         }     // end of else
                   }//end of doInitialisation()
         * Method          :           onUpdate()
         * Description      :                         
         * Input Parameters     :     object of Event class
         * Returns          :          None
                   public void onUpdate(Event e)throws PageException
                        /*     sets flag to 1 when update button is clicked. */
                        iFlag=1;
         * Method          :           doProcessAfterInput()
         * Description      :                         
         * Input Parameters     :     None
         * Returns          :          None
                  public void doProcessAfterInput() throws PageException
                             InputField ifFirstName = (InputField) getComponentByName("FirstName");
                             InputField ifSecondName = (InputField) getComponentByName("SecondName");
                             InputField ifAge = (InputField) getComponentByName("Age");
                             InputField ifExp = (InputField) getComponentByName("Exp");
                             InputField ifSkill = (InputField) getComponentByName("Skill");
                             DropdownListBox dlbUnit = (DropdownListBox) getComponentByName("Unit");
                             int iAge,iExp;
                             IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
                            IPortalComponentContext myContext = request.getComponentContext();
                             P_SAP_B_CreateUser myNameContainer = (P_SAP_B_CreateUser) myContext.getValue("createUserBean");
                             if(ifFirstName != null)
                                  this.sFname = ifFirstName.getValueAsDataType().toString() ;
                             }     // end of if
                             if(ifSecondName!= null)
                                  this.sSname = ifSecondName.getValueAsDataType().toString() ;
                             }      // end of if
                             if(ifAge!= null)
                                  this.sAge = ifAge.getValueAsDataType().toString() ;
                             }     // end of if
                             if(ifExp!= null)
                                  this.sExp = ifExp.getValueAsDataType().toString() ; 
                             }     // end of if                         
                             if(ifSkill != null)
                                  this.sSkill = ifSkill.getValueAsDataType().toString() ;          
                             }     // end of if
                             if(dlbUnit != null)
                                  this.sUnit = dlbUnit.getSelection().toString() ;     ;
                             }      // end of if
                          /* Data Validation */
                             /* try block for numeric Exception */
                             try
                                 /* checking for any field left blank by the user */
                                  if(sFname.equals("") || sSname.equals("") ||  sAge.equals("")|| sExp.equals("") || sSkill.equals(""))
                                        /* set error flag to 1 in case of any field left blank */
                                        iErrFlag=1;
                                  } // end of if
                                  else
                                        /* converting Age and Experience fields (String) to integer */
                                         iAge= Integer.parseInt(sAge);
                                         iExp= Integer.parseInt(sExp);
                                       /* setting the boundaries on the value in Age Field */
                                         if(iAge<0)
                                             /* set error flag to 2 in case of age below 0 */
                                             iErrFlag=2;
                                         }// end of if
                                       /* setting the boundaries on the value in Experience field */
                                          else if(iExp<0 ||(iExp/12)>=iAge)
                                              /* set error flag to 3 in case of experience below 0 or exceeding the age in years */
                                              iErrFlag=3;
                                          }// end of else if
                                          /* In case of no error */
                                          else
                                             /* setting the bean variables */
                                             try
                                                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                                 Connection con = DriverManager.getConnection("jdbc:odbc:Test");
                                                 String query="insert into UserData values(?,?,?,?,?,?)";
                                                 PreparedStatement prestat=con.prepareStatement(query);
                                                 /* setting the values to be inserted into the user table */
                                                 prestat.setString(1,sFname);
                                                 prestat.setString(2,sSname);
                                                 prestat.setString(3,sAge);
                                                 prestat.setString(4,sExp);
                                                 prestat.setString(5,sSkill );
                                                 prestat.setString(6,sUnit);
                                                 prestat.executeUpdate() ;
                                                 prestat.close();
                                                 con.close();
                                                 myNameContainer.setSFname(sFname);
                                                 myNameContainer.setSLname(sSname);
                                                 myNameContainer.setSAge(sAge);
                                                 myNameContainer.setSExp(sExp);
                                                myNameContainer.setSSkill(sSkill);
                                                myNameContainer.setSUnit(sUnit);
                                             } // end of inner try block
                                              catch(Exception sqle)
                                                 myNameContainer.setErrMessage("Update failed ! Please try again." );
                                              } // end of catch corresponding to inner try
                                                           } // end of inner else
                                                      } //end of outer else
                                   } //end of outer try block
                                   catch(Exception e)
                                     /* setting flag to 4 in case of non-numeric age/experience values */
                                     iErrFlag = 4;
                                     /* Displaying error message corresponding to the value of error flag */
                                  switch(iErrFlag)
                                    /* Empty Field */
                                    case 1:myNameContainer.setErrMessage( "Please Fill all the fields");
                                    break;
                                    /* Invalid Value in the age field */
                                    case 2:myNameContainer.setErrMessage( "Enter a valid value in Age field.(Hint : Have you entered Age<0 ?");
                                    break;
                                    /* Invalid Value in the experience field */
                                    case 3:myNameContainer.setErrMessage( "Enter a valid value in Experience field.(Hint : Experince should not be negative or greater than your age in months)");
                                    break;
                                    /* Non-numeric value in the Age/ experience fields */
                                    case 4:myNameContainer.setErrMessage( "Please Enter Numeric Value for Age and Experience");
                                    break;
                                 } // end of switch-case block
              } //end of doProcessAfterInput()
         * Method          :           doProcessBeforeOutput()
         * Description      :                         
         * Input Parameters     :     None
         * Returns          :          None
                  public void doProcessBeforeOutput() throws PageException
                       /* Displays Form for new user creation by default */
                       this.setJspName("P_SAP_B_UserCreationForm.jsp");
                         /* In case of an error display an error message page */
                         if(iErrFlag!=0)
                              setJspName("ErrorPage.jsp");
                         } //end of if
                         /* Displays the user's information as entered in the SQL
                            database after its been uploaded by the user */
                         else if(iFlag==1)
                             setJspName("hello.jsp");      
                          } // end of else if
                  } // end of doProcessBeforeOutput()
              } // end of P_SAP_B_UserDynPage Class
         } // end of P_SAP_B_User class
    * End of File P_SAP_B_User.java
    2) Bean
    package com.sap.usercreation;
    import java.io.Serializable;
    public class P_SAP_B_CreateUser implements Serializable
         private String sFname;
         private String sLname;
         private String sUnit;
         private String sSkill;
         private String sExp;
         private String sAge;
         private String errMessage;
         * @return
         public String getSFname() {
              return sFname;
    * @return
    public String getSLname() {
         return sLname;
    * @param i
    * @param string
    public void setSFname(String string) {
         sFname = string;
    * @param string
    public void setSLname(String string) {
         sLname = string;
    * @return
    public String getSUnit() {
         return sUnit;
    * @param string
    public void setSUnit(String string) {
         sUnit = string;
    * @return
    public String getSSkill() {
         return sSkill;
    public void setSSkill(String string) {
         sSkill = string;
    * @return
    public String getSAge() {
         return sAge;
    * @return
    public String getSExp() {
         return sExp;
    * @param string
    public void setSAge(String string) {
         sAge = string;
    * @param string
    public void setSExp(String string) {
         sExp = string;
    * @return
    public String getErrMessage() {
         return errMessage;
    * @param string
    public void setErrMessage(String string) {
         errMessage = string;
    3) The Jsp file i have already posted.
    See if you copy this code and paste it wont work as i have not given you full code ,But yes this gives you an overview of how things can be done .
    Thanx
    Pankaj

  • Database connection and display in JSP page

    hi,
    I am new to SAP netweaver. I have created a project using JSPDynPage, Beans and java file. I have configure the datasouce in Visual Composer. I deploy the project on the portal itself. I have try all kinds of codes bt cannot retrieve. Is there anyone can give a same codes for mi to connect to the datasource in Visual Composer and able to retrieve data, insert data and update data in SQL Server 2000. Thanks
    Regards,
    shixuan

    Hai Shixuan,
    Refer this link. I will helps
    Access data from SqlServer through Visual Composer.....?
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fe/68e343cc68414da4426258d3e896ae/content.htm
    Write this code wher you need in JSPDynPage
    And
    MSSQL DataBase Access -> Help me
    Thanks and Regards
    Venkatesh
    Message was edited by:
            Venkatesh Ranganathan
    Message was edited by:
            Venkatesh Ranganathan

  • Read a property file and store it in a hashmap

    Hi,
    I have tried to read a property file and store it in a hashmap. The property-names should be stored in keys and the property-values (after = symbol) in values of the hashmap. any ideas? Is it possible to do this?

    mandy2001ir wrote:
    yes, but I need the hashmap for another reason. Actually I'm trying to use the properties file to have a dynamic hachmap. I don't want to change the code anytime I want to put a value in the hashmap. therefor I write the "keys" and "values" in a property file and change the property file. That's the reasn why we have property files, isn't it?What's a "dynamic hashmap"? There's no other kind! Whenever someone starts bandying around the word "dynamic" in contexts like this, it usually means there's a simple solution to their problem, that they haven't yet considered, or mistakenly don't believe is applicable to them, because of this "unique" need for something "dynamic". Trust me, you just need to load the file using a Properties object, and you're done. Properties extends Hashtable, which is virtually the same thing as a HashMap. Properties does exactly what you want it to. it's the very reason the class exists
    Have you even looked at the javadoc for java.util.Properties yet? I'm betting not, because if you had, you'd know exactly what I meant. And since you haven't, I'm at a bit of a loss as to how you can so easily dismiss the class as useless, despite existing to do exactly what you need

  • I am trying to build a basic TCL skeleton script that reads a remote SNMP OID and displays the value on the screen.

    I am trying to build a basic TCL skeleton script that reads a remote SNMP OID and displays the value on the screen.
    I don't want it to be an EEM Event, I just want to run it from the (tcl)# prompt.
    So I guess I'm asking if you can use cli_exec and other commands in the "namespace import ::cisco::eem::*" in a normal non-EEM script - can I do that?
    This is the error I get:
    OTN.159(tcl)#source flash:TCL_SNMP_Remote_Read.tcl
    invalid command name "::cisco::eem::event_register_none"             ^
    % Invalid input detected at '^' marker.
    What am I missing?
    =================  TCL_SNMP_Remote_Read.tcl  ==============================
    ::cisco::eem::event_register_none
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    if [catch {cli_open} RESULT]
        { error $RESULT $errorInfo }
        else { array set cli1 $RESULT }
    if [catch {cli_exec $cli1(fd) "snmp get v2c 192.168.1.100 public timeout 1 oid 1.3.6.1.2.1.1.1.0" } RESULT]
           { error $RESULT $errorInfo  }
           else { set SnmpSysDesc $RESULT }
    if [catch {cli_close $cli1(fd) $cli1(tty_id)} RESULT] {
                error $RESULT $errorInfo
    puts $SnmpSysDesc
    =========================================================================
    In the sho-run config I have:
    event manager directory user policy "flash:/"
    event manager session cli username "cisco"
    Any help to get me started would be greatly appreciated!
    Tim

    If you don't want an EEM policy, then don't use any of the EEM constructs.  Instead, all you need is this:
    set output [exec "snmp get v2c 192.168.1.100 public timeout 1 oid 1.3.6.1.2.1.1.1.0"]puts $output

  • List Box showing Value and Display members?

    Ok this is a CONCEPT problem (the code is not professional, just read it for the concept, though it does compile and run).
    Right, I have asked many people on IRC and no one is giving me a straight answer lol so maybe some professionals can help me.
    I am trying to use a Datasource property for my combobox. This is so I can just pass an entire KeyValue pair with indexes and values to be shown in the listbox.
    Creating the keyvaluepair as a WHOLE and passing that to datasource property works perfectly.
    Creating a keyvaluepair PROCEDURALLY (in a loop or w/e) ends in the datasource property ToString()ing it, list box items show BOTH value AND display members in square brackets as an entire option.
    NOTE: Getting the lsitbox.value results in ONLY the valuemember being returned even though the listbox shows both the valuemembers AND the displaymember? it knows they are different?
    Now, I dont want any alternatives or comments about the quality of the code, all I want to know is WHY is it doing this, it seems compeltely illogical that the same TYPE and Values and can different Effects within the datasource property? Its like it knows
    it was built procedurally?
    Anyway here is some code for reference:
    // Windows Form
    namespace skbtInstaller
    public partial class frmMainWindow : Form
    public frmMainWindow()
    InitializeComponent();
    // coxArmaPath = Combo Box (simple drop down)
    this.cBoxArmaPath.ValueMember = "Key";
    this.cBoxArmaPath.DisplayMember = "Value";
    public void addServerPathItem(String Key, String Value)
    this.cBoxArmaPath.Items.Add(new KeyValuePair<String, String>(Key,Value));
    // This works fine, only the "DisplayMember" is displayed and the "ValueMember" is hidden.
    // This acts differently with the same types???
    public void setServerPathDatasource(List<KeyValuePair<String, String>> source)
    this.cBoxArmaPath.DataSource = new BindingSource(source, null);
    public class skbtServerControl
    private frmMainWindow frmMainWindowHandle;
    public void refreshformWindow()
    // Clear Drop Box (empties drop box)
    this.frmMainWindowHandle.clearPathBox();
    //skbtServerConfig is very simple property object
    foreach (KeyValuePair<String, skbtServerConfig> pair in CoreConfig.getServerConfigList())
    // Populate Drop Box
    this.frmMainWindowHandle.addServerPathItem(pair.Key, pair.Value.getTextualName()); // this works as intended
    // cBox gets items like: Some Display Text, Some Display Text, Some Display Text (PERFECT!)
    // This works absolutely fine. ValueMembers are hidden.
    public void refreshformWindowWithSTATICDatasource()
    // Clear Drop Box
    this.frmMainWindowHandle.clearPathBox();
    var pathDataSource = new List<KeyValuePair<String, String>>()
    new KeyValuePair<String, String>("testKey1", "somevalue1"),
    new KeyValuePair<String, String>("testKey2", "somevalue2"),
    new KeyValuePair<String, String>("testKey3", "somevalue3")
    // Populate Drop Box
    this.frmMainWindowHandle.setServerPathDatasource(pathDataSource);
    // cBox gets items like: Some Display Text, Some Display Text, Some Display Text (PERFECT!)
    // ** HERE IS THE PROBLEM?? **
    // This creates a type that seems different to the above function which works fine...
    public void refreshformWindowWithDatasource()
    // Clear Drop Box
    this.frmMainWindowHandle.clearPathBox();
    var pathDataSource = new List<KeyValuePair<String, String>>();
    //skbtServerConfig is very simple property object
    foreach (KeyValuePair<String, skbtServerConfig> pair in CoreConfig.getServerConfigList())
    pathDataSource.Add(new KeyValuePair<String, String>(pair.Key, pair.Value.getTextualName()));
    // Populate Drop Box
    this.frmMainWindowHandle.setServerPathDatasource(pathDataSource);
    // cBox gets items like [asjAETJQ5785d45,Some Display Text], [asawfgQ5785d45,Some Display Text], [asjAhrrQ5785d45,Some Display Text]
    // ????? surely this function should act exactly like the function above??
    Thanks!
    (I have posted on codeproject too, will condense any replies).
                 

    Thanks Michael!
    I did debug this and it turns out when i set a new BindingSource to the combo box, indeed the DisplayMember gets reset. Oddly though, the ValueMember stays the same.
    I have fixed this with setting the Members before every new bindingSource is set to the combobox, strange that only the displaymember is reset?
    For reference, the new resolved code: (this compiles albeit with designer components placed)
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    namespace etstapp1
    public partial class Form1 : Form
    private skbtServerControl sc;
    public Form1()
    InitializeComponent();
    this.sc = new skbtServerControl(this);
    // coxArmaPath = Combo Box (simple drop down)
    this.cBoxArmaPath.ValueMember = "Key";
    this.cBoxArmaPath.DisplayMember = "Value"; // This doesnt seem to stick after the first datasource set??
    public void addServerPathItem(String Key, String Value)
    this.cBoxArmaPath.Items.Add(new KeyValuePair<String, String>(Key, Value));
    // This works fine, only the "DisplayMember" is displayed and the "ValueMember" is hidden.
    // This acts differently with the same types???
    public void setServerPathDatasource(List<KeyValuePair<String, String>> source)
    this.cBoxArmaPath.DisplayMember = "Value"; // fix datasource problem
    this.cBoxArmaPath.ValueMember = "Key"; // fix datasource problem
    this.cBoxArmaPath.DataSource = new BindingSource(source, null);
    public void clearPathBox()
    if(this.cBoxArmaPath.DataSource == null){
    this.cBoxArmaPath.Items.Clear();
    else
    this.cBoxArmaPath.DataSource = null;
    private void btnStatic_Click(object sender, EventArgs e)
    this.sc.refreshformWindowWithSTATICDatasource();
    private void btnNormal_Click(object sender, EventArgs e)
    this.sc.refreshFormWindow();
    private void btnDynamic_Click(object sender, EventArgs e)
    this.sc.refreshformWindowWithDatasource();
    public class skbtServerControl
    private CoreConfig CoreConfig;
    private Form1 frmMainWindowHandle;
    public skbtServerControl(Form1 f){
    this.frmMainWindowHandle = f;
    this.CoreConfig = new CoreConfig();
    public void refreshFormWindow()
    // Clear Drop Box (empties drop box)
    this.frmMainWindowHandle.clearPathBox();
    //skbtServerConfig is very simple property object
    foreach (KeyValuePair<String, skbtServerConfig> pair in CoreConfig.getServerConfigList())
    // Populate Drop Box
    this.frmMainWindowHandle.addServerPathItem(pair.Key, pair.Value.getTextualName()); // this works as intended
    // cBox gets items like: Some Display Text, Some Display Text, Some Display Text (PERFECT!)
    // This works absolutely fine. ValueMembers are hidden.
    public void refreshformWindowWithSTATICDatasource()
    // Clear Drop Box
    this.frmMainWindowHandle.clearPathBox();
    var pathDataSource = new List<KeyValuePair<String, String>>()
    new KeyValuePair<String, String>("testKey1", "somevalue1"),
    new KeyValuePair<String, String>("testKey2", "somevalue2"),
    new KeyValuePair<String, String>("testKey3", "somevalue3")
    // Populate Drop Box
    this.frmMainWindowHandle.setServerPathDatasource(pathDataSource);
    // cBox gets items like: Some Display Text, Some Display Text, Some Display Text (PERFECT!)
    // ** HERE IS THE PROBLEM?? **
    // This creates a type that seems different to the above function which works fine...
    public void refreshformWindowWithDatasource()
    // Clear Drop Box
    this.frmMainWindowHandle.clearPathBox();
    var pathDataSource = new List<KeyValuePair<String, String>>();
    //skbtServerConfig is very simple property object
    foreach (KeyValuePair<String, skbtServerConfig> pair in this.CoreConfig.getServerConfigList())
    pathDataSource.Add(new KeyValuePair<String, String>(pair.Key, pair.Value.getTextualName()));
    // Populate Drop Box
    this.frmMainWindowHandle.setServerPathDatasource(pathDataSource);
    // cBox gets items like [asjAETJQ5785d45,Some Display Text], [asawfgQ5785d45,Some Display Text], [asjAhrrQ5785d45,Some Display Text]
    // ????? surely this function should act exactly like the function above??
    public class CoreConfig
    public Dictionary<String, skbtServerConfig> getServerConfigList(){
    return new Dictionary<string, skbtServerConfig>()
    {"somekey1", new skbtServerConfig("somename1")},
    {"somekey2", new skbtServerConfig("somename2")}
    public class skbtServerConfig
    private String name;
    public skbtServerConfig(String name)
    this.name = name;
    public String getTextualName()
    return this.name;
    Talking with someone it seems logical that every time I set a new BindingSource the component will not know if I want to keep the same member values so it resets them, but why it only resets displaymember? very strange to me.
    Thanks again.

  • In Vista,  Applet isn�t able to read the property files

    I�m working on internationalization; the Applet which I�m using wasn�t able to read the property files properly in windows Vista machine. But if I create a jar which contains all the classes and property files, Applet works fine.
    This problem is only in Vista machine ,In XP the JVM is smart enough to read plain .property files and its works well without creating the jar
    Is that related to any security enhancemence of vista over XP?
    Below is a link about The Java Security Model break on Windows Vista
    http://bugs.sun.com/view_bug.do?bug_id=6548078
    I tried a simple ResourceBundle.getBundle() in my Applet in different ways but nothing work fine for me. It isn�t an issue related to path, I guess because I tried several ways like.
    ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle");
    ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle",currentLocale);
    ResourceBundle labels = ResourceBundle.getBundle("com.test.LabelsBundle");
    ResourceBundle labels = ResourceBundle.getBundle("com.test.LabelsBundle",currentLocale);The exception got in java console is
    CONFIG: [2008-05-13 15:54:57.909]:(com.satm.insite.InsiteApplet$2@1696e4c):InisiteApplet: Exception:  java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en
    java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en
                at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
                at java.util.ResourceBundle.getBundleImpl(Unknown Source)
                at java.util.ResourceBundle.getBundle(Unknown Source)
                at com.satm.insite.InsiteApplet.displayValue(InsiteApplet.java:261)
                at com.satm.insite.InsiteApplet.callme(InsiteApplet.java:296)
                at com.satm.insite.InsiteApplet.initialize(InsiteApplet.java:327)
                at com.satm.insite.InsiteApplet$2.run(InsiteApplet.java:235)
                at com.satm.tools.languageTools.ThreadPool$ExceptionCatchingThread.run(ThreadPool.java:226)Is there any way to make it work in Windows Vista machine�? This could be a great help for me.
    Thanks
    Robert

    Crossposted:
    http://forum.java.sun.com/thread.jspa?threadID=5295743&messageID=10250558#10250558
    http://forum.java.sun.com/thread.jspa?threadID=5295742&messageID=10250556#10250556

  • Error while reading a property file from a war.

    Hi,
    I am trying to read a property file which is available in the properties folder.
    The piece of code that does this read is as follows.
    InputStream is = ClassLoader.getSystemResourceAsStream("codemap.properties");
    System.out.println("Reading file:"+is);
    properties.load(is);
    The "codemap.properties" file is available in the properties folder.
    Following is my directory structure in the war file
    sample.war
    |
    |
    WEB-INF
    |
    |
    classes
    |
    |
    properties
    |
    |______ codemap.properties
    Inside the war file I have WEB-INF and properties folder.
    Inside WEB-INF i have the classes folder which has the classes
    Inside the properties folder I have the codemap.properties file.
    I am using Jboss. In the class path I have ./properties
    I have also added this classpath in the manifest file.
    Problem: The piece of code that I have written to read the property file is not able to locate the file and this it returns null.
    I am not sure what i am missing here.
    If anyone there have any solutions please let me know.
    Thanks in Advance
    Balaji.

    I think you've to change this line
    InputStream is = ClassLoader.getSystemResourceAsStream("codemap.properties");with this.
    InputStream is = ClassLoader.getSystemResourceAsStream("properties/codemap.properties");it is unable to find the path you specified. by default it'll check the WEB-INF directory. so you've to give the relative path to it.
    Diablo

  • Read a property file !

    Hi all,
    i have to read a property file; i put it under the directory WEB-INF/classes so i can read it using the classloader.
    This works fine under Tomcat, but when i put my webapplication under SunONE, i must put this file under the directory /server1/config.......how cai force the system to read the file from the WEB-INF/classes directory without specifing an absolute path ?
    Cheers.
    Stefano

    There are a couple of ways, but you need the ServletContext object.
    ServletContext.getRealPath("websitePath")
    ServletContext.getResourceAsStream("websitePath")
    The first method converts a website relative path to a location on disk - eg /config -> c:\tomcat\webapps\myApp\config
    The second actually opens a file at that location, and returns an input stream to it.
    The second can be more portable, because if the container you are using does not "explode" the WAR file, the path returned refers to the target within the WAR file - and the java.io functions don't handle that case.
    Cheers,
    evnafets

  • How to read a property file..urgent

    Hi ,
    This is kinda urgent if you can help! I am a new bee to servlet and java.
    My JSP calls a java class file. In the class file i establish my connection to database.
    My requirement is to read a property file for the database name, username and password and connet to the database using JDBC(database is oracle).
    which class to use. I know something about properties class. Is there any other class which can read my property file.
    Or is there any other all together a better way to do it.
    thanks in advance
    Amit

    Inside your WAR file somewhere under the WEB-INF directory. This space is protected, whereas the ROOT (of course) is not. Unless you would like someone else to read your properties file...
    Once you decide where you want it, post the section of code where you load the properties file, we can probably help you figure out where you path is wrong.

  • Getting file location and display!

    Hello friends,
    I need to find out the file path and display it using java.
    Is it any specific java cmd for it.
    For example, if i store a file in d:/javaworks/ram/one.txt, then i need to retrieve the path and show it in command window.
    pls, reply me as soon as possible.

    For example, if i store a file in d:/javaworks/ram/one.txt, then i need to retrieve the path and show it in command window.Using your example above, since you know where you placed it, use
    System.out.println("d:/javaworks/ram/one.txt");

  • Make the property file separate and remain just text file

    when I go "data" menu - "connect to Web Service..." to generate classes for webservice client,
    In the WSDL file the IP address is set.
    if the ip address doesn't vary, that doesn't matter at all.
    but I have to make client for general case which means the webservice server ip is not set, so I want make property file(text file) for IP address.
    if I compile the files(*.as) they compiled and include the ip address in it so I can't see any property file in the deployed folder.
    How can I make the property file separate and just change the ip address any time, any place.
    I used
    <mx:Metadata>
      [ResourceBundle("flex_dmb")]
    </mx:Metadata> 
    I don't know flex very well.
    I just click and click...
    Thanks.

    I use flex 4

  • How to print a PDF file that was display in my page...

    Hi !. My doubt would be the following one... I would like to know how to print a pdf file that was displayed in my page ?... I mean the PDF file not the page...
    The PDF would be in this url:
    http://iprodesa.lasegunda.com.ar:8090/datos/pdf/830.pdf
    How could I implement this ?...

    This first question which comes to mind is how do you display the pdf file in the browser?
    For this the browser uses a plug in (e.g. adobe reader) which already has the ability to print the pdf file. Depending on the version of your plug in, printing is started differently.
    Timo
    Ps: which jdev version do you use?

  • My pdf files do not display the full page on Creative Cloud (side of pages missing)

    Hello
    My pdf files do not display the full page on Creative Cloud (side of pages missing).
    Does anyone else have this problem?
    Thanks

    Creative Cloud is the process used to download and install programs... which program are you using?
    If Acrobat, http://forums.adobe.com/community/acrobat may be a better place to ask

  • New to web design. how to add feedback form and display comments in page?

    I have created a site using muse. Cient wants me to add a feedback page that has form and displays comments on page. She only wants to pay for web basics bc plan. I know I can export html and can edit using DW but I have never done this nor do I know much about coding.
    Does anyone know how to do this and could walk me thru it please?
    Thank you in advance

    Hello,
    There are ample learning resources that will teach you how to achieve this. Please see if the following help you:
    http://www.adobe.com/inspire/2012/12/configuring-forms-muse.html
    http://tv.adobe.com/watch/adobe-inspire-magazine/configuring-forms-in-adobe-muse/
    http://www.adobe.com/in/products/muse/html-contact-forms.html
    Regards,
    Suhas Yogin

Maybe you are looking for

  • Adobe Acrobat XI PRO crash in Maverics

    Hello, My Adobe x and XI PRO will not run anymore since i upgraded to MAverics. I did a total removal and re-install of entire Adobe Creative Suite, and Adobe Acrobat. "Configuration error"  "Error 16" Called apple seems to be a issue with Adobe Lice

  • Multiple query support for BICS

    Hi, Here are few queries: 1 - Does new BICS connection support multiple BW queries for a dashboard? Any limitations with BICS? 2 - How does Xcelsius handle huge data coming from BW in queries? 3 - is EHP4 on ERP side a mandatory thing for upgrade to

  • How to add a device

    i plug my iPhone 5s into my computer and it starts charging and asks if i trust the computer but it doesn't show up as a device in iTunes

  • Unable to print Excise invoice

    Hi Experts I am using  return PO to do return to Supplier from Depot which creates 161 movement(MIGO) Following is the process followed 1. Create a return PO 2. MIGO with respect to return PO 3. Capture the excise invoice with respect to the material

  • Shared applications among user profiles?

    My wife and I have separate user profiles for our home computer. When I upload photos she can not access them from iPhoto unless she is logged in to my profile. The same is true for me if she uploads photos. Is there a way for us to have a universal