JSP forms and config files

Hi, i am new i Java, at least in writing JSP. I have few questions.
I'm working on simple login\register web application.
'Cause this is just "school" task, i tried to make it work with simple form fields control in jsp file and forwarding that request to servlet. For database of users, i'm using mysql 4.1 database. i would like to know next.
How i can remove code form servlet that is connecting through org.gjt.mm.mysql.Driver on database, and make another class that will return me something that is result of this, and what should result be?
Also, 'cause of this newmade class, how i'm supposed to make and organize config file in witch i could place jdbc driver and connection url, username and password to my database, so i could only call previous made class's method without changing it's code? this is needed in case i change my database server.
Also, though this is not a question, then asking, where i can find some little more of lessons in this, or an example, so i could see just a little of this thematics how this works in reality?
Thank u.

So you want to be able to configure your database seperately of your web app. In a config file somewhere.
How i can remove code form servlet that is connecting through
Zorg.gjt.mm.mysql.Driver on database, and make another class that
will return me something that is result of this, and what should result be?The current approach is to use a DataSource object to access database connections. Often the DataSource is accessed via JNDI
how i'm supposed to make and organize config file in witch i could
place jdbc driver and connection url, username and password to my databaseUnsurprisingly, most application servers will do this for you.
Here is a link to how Tomcat configures it:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html

Similar Messages

  • How do you extract SQL from Oracle Forms and Reports files?

    I am developing an "as is" data model for a government client for a 14 year old system that has three databases, 20 schemas, over 1500 tables, and over 23,000 columns. Needless to say, I do not plan to perform a manual mapping of data to screens and reports.
    Most of the system has been developed in Oracle Forms and Reports. I am trying to map the live tables and columns to forms and reports.
    The process here has been to save the forms and reports files as .fmb and .rdf files. The client does not have an available copy of Oracle Designer, which I understand could be used to extract the SQL.
    Is there a utility somewhere that can parse the .fmb and .rdf files to extract the SQL?
    Thanks,
    Jim Gearing

    Jim,
    I don't know of any utility that will do this. You can convert and save each fmb as a fmt so you can view/search the contents , but I don't recommend that approach.
    On the other hand, you download a copy of Oracle Designer:
    http://www.oracle.com/technology/software/index.html
    It usually is included with Oracle Forms and Reports.

  • Appropriate directory for themes, logs and config files

    Hello, I would like to know what would be the appropriate directory to place a application's config directory that contains themes, logs and config files for that application.
    I want that directory to be accessible but since ~/Library is now invisible on Lion, that kinda rules it out for accessibility. The only place left now would be ~/Applications, but I don't think it was intended for that.
    There is also an invisible config file that contains the path to the config directory and that's what the app uses to know where the config directory is located. The current emplacement of that config file is in the home directory, which I think is not in accordance to Apple's guidelines. So where should I place that file?
    What should I do?
    Thanks

    Whee wrote:
    I wish I could choose both of your answers as being the good one.
    Thanks for the additional info about the Home and Documents directory, that clears a lot of things up. I needed to know that too. Do you know where that documents is located now? http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFileSy stem/Articles/WhereToPutFiles.html
    Apple prefers you use the system API for these things. Here is one document that explains it.
    So even though I won't use NSDefaults because what I am working on is a cross Platform app that is in C, I will put the config file in ~/Library/Preferences and the config folder in ~/Library/Application Support.
    Almost everything has a C equivalent. You can use CFPreferences instead. I strongly urge you to use one of the system APIs instead of trying to write your own files. For one thing, the user can put their home directory virtually anywhere they want. For another, Lion is rewriting the underlying architecture with the new screen sharing and iCloud. If you use the system APIs, your program will work properly with any new technologies or custom network settings.

  • XML file in the form of .config file how to convert it to class and store it in single object

    Hi,
    I have a config file in which i have to convert it to class and get an object.
    example:
    <?xml version="1.0" encoding="utf-8" ?>
    <xyz xmlns="">
      <Container name ="Basic">
        <Connectivity user="" server="" protocol="udp"/>
        <Connectivity user="" server="" protocol="udp"/>
      </Container>
      <Container name ="Cp">
        <settings version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.counterpath.com/cps">
          <domain name="audio">
            <section name="headset">
              <setting name="audio_in_agc_enabled " value="1"/>
            </section>
            <section name="incoming">
              <setting name="use_agc" value="1"/>
            </section>
            <section name="vad">
            </section>
          </domain>
          <domain name="system">
            <section name="qos">
              <setting name="audio" value="tos 46"/>
            </section>
            <section name="dtmf">
              <setting name="force_send_in_band" value="0"/>
              <setting name="minimum_rfc2833_play_time" value="40"/>
            </section>
            <section name="network">
              <setting name="dtx_enabled" value="0"/>
            </section>
            <section name="diagnostics">
              <setting name="enable_logging" value="1"/>
              <setting name="log_level" value="Error"/>
            </section>
            <section name="general">
              <setting name="add_OS_version_to_user_agent_header" value="1"/>
            </section>
            <section name="indialog_notify">
              <setting name="enable_indialognotify" value="1"/>
            </section>
          </domain>
          <domain name="rtp">
            <section name="2833">
              <setting name="enabled" value="1"/>
              <setting name="packet_time_in_ms" value="60"/>
              <setting name="payload_number" value="101"/>
            </section>
            <section name="inactivity">
              <setting name="timer_enabled" value="0"/>
            </section>
          </domain>
          <domain name="proxies">
            <section name="proxy0">
            </section>
            <section name="proxy1">
            </section>
          </domain>
          <domain name="ggg">
            <section name="device">
              <setting name="use_headset" value="1"/>
              <setting name="rrr" value="1"/>
              <setting name="eee" value="480"/>
              <setting name="eme" value="hhh"/>
              <setting name="headset_name" value="vvv"/>
              <setting name="manual_audio_devices_configure" value="0"/>
              <setting name="audio_in_device" value=""/>
              <setting name="audio_out_device" value=""/>
              <setting name="ringer_device" value=""/>
            </section>
            <section name="system">
              <setting name="export_settings" value="EndpointSettings.xml"/>
              <setting name="enable_export_settings" value="0"/>
              <setting name="log_level_AbstractPhone" value="0"/>
              <setting name="log_level_Audio" value="0"/>
              <setting name="log_level_Auto Configuration" value="0"/>
              <setting name="log_level_CCM" value="0"/>
              <setting name="log_level_Conferencing" value="0"/>
              <setting name="log_level_Contacts" value="0"/>
              <setting name="log_level_DNS" value="0"/>
              <setting name="log_level_GUI" value="0"/>
              <setting name="log_level_Jitter" value="0"/>
              <setting name="log_level_Licensing" value="0"/>
              <setting name="log_level_Media" value="0"/>
              <setting name="log_level_Privacy" value="0"/>
              <setting name="log_level_RTP" value="0"/>
              <setting name="log_level_STUN" value="0"/>
              <setting name="log_level_Security" value="0"/>
              <setting name="log_level_Storage" value="0"/>
              <setting name="log_level_Transport" value="0"/>
              <setting name="log_level_USB Devices" value="Info"/>
              <setting name="log_level_Utilities" value="0"/>
              <setting name="log_level_Video" value="0"/>
              <setting name="log_level_Voice Quality" value="0"/>
              <setting name="log_level_XMPP" value="0"/>
              <setting name="log_level_Endpoint" value="6"/>
            </section>
            <section name="beeptone">
              <setting name="play_locally" value="0"/>
              <setting name="enable_beeptone" value="1"/>
              <setting name="beeptone_file" value="beep.wav"/>
              <setting name="beeptone_timeout" value="30000"/>
            </section>
            <section name="dtmf">
              <setting name="play_locally" value="1"/>
              <setting name="pause_start_stop_dtmf" value="100"/>
            </section>
            <section name="control">
              <setting name="auto_answer" value="0"/>
            </section>
            <section name="ctrol">
              <setting name="auto_ans" value="0"/>
            </section>
          </domain>
        </settings>
      </Container>
    </xyz>
    Please help me out in creating an object from it.
    Thanks,
    Hiranmayee

    It's one of those things you usually start from the other end.
    IE with a class and then serialise / deserialize to xml.
    Because you have a namespace in there:
    <settings version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.counterpath.com/cps">
    I think you will find linq to xml will have issues with that.
    You could still use xpath to pick data out of there and there's been a thread on the c# forum recently which is relevent:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/2dc0581e-f2fd-4fd3-89ee-e59280c398e6/read-xml?forum=csharpgeneral
    Why do you want to turn that into an object?
    By the way.
    This isn't a wpf question and you should probably have posted it on the c# forum.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Class library in a web app and config files

    I built some class libraries and included them in a web project. Where do I put configuration files so the class library can access them? no matter where I put it, i keep getting file not found. What I've been doing is having a JSP read the config details and pass it to the class library. Is there another way?

    I guess the question is where IT thinks the file is? What code are you using to load it?
    I guess what I'm asking is where is the default folder for FileInputStream?The default folder is your runtime working directory. More often than not thats the "bin" directory of Tomcat. Not a great place to go looking for files.
    getResource() and all that can be accessed from the JSP but those aren't available to me from within the class libraries. Are you saying you don't have access to a ClassLoader object that you can call getResource or getResourceAsStream on? You should be able to access things in the WEB-INF/classes directory in that way.
    Given a web app, my first inclination would be to use the ServletContext.getResourceAsStream method.
    Rather than passing in a file name, why not an InputStream, or byte[] ?
    cheers,
    evnafets

  • JSP forms and UTF-8

    Hi!
    I have a problems with JSP's and the UTF-8 encoding. I have a simple JSP page like this:
    <%@page contentType="text/html; charset=UTF-8" %>
    <html>
    <head>
    </head>
    <body>
         <form action="index.jsp" method="post">
              <input type="text" name="jee" value="<%=request.getParameter("jee")%>">
         </form>
    </body>
    </html>
    The problem is that all nonstandard characters, such as the scandinavian characters, get messed when I post the form. For instance, the � character changes to ��.. I tried this with Tomcat 4.0.3 and Orion Application Server 1.5.2 with the same result. What's wrong?

    Hi,
    I think You have to tell Tomcat that the encoding of the requests is in UTF-8.
    Unfortunately I don't know where You have to do it, I guess some configuration file.
    Maybe You can find more Info in the Internationalization Forum.
    Jan

  • How to Add JAR files and Config files to CLASSPATH at runtime?

    QUERY:
    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    Thanks in advance.

    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    You don't add to YOUR classpath once your app is launched.
    You create a NEW process for the app you want to run and provide the proper environment for it to run in - including any PATH or CLASSPATH environment variables.
    The Java API for the ProcessBuilder class has a simple example that shows how to create the arguments and launch an external application.
    ProcessBuilder (Java Platform SE 7 )
    There are also PLENTY of other examples of using ProcessBuilder; just search the net.

  • Makepkg, upgrade and config-files

    Hello,
    At the moment I work on a package for the programm "vdr". Without any start-parameters (in this case: -c /etc/vdr) vdr save and load its config files in the folder /mnt/vdr-recordings. 
    In the future i would like to use the start-parameter (-c /etc/vdr). With this parameter vdr loads its config files from /etc/vdr.
    vdr creates some default config files during the make process. Afterwards I copy the files from /mnt/vdr-recordings to /etc/vdr.
    This work fine 
    Now my problem: ;-)
    If I want to update vdr with a new version (pacman -U vdr-1.3.35-2.tar.gz), pacman overwrite all config files in /etc/vdr, although I changed the config files after installing vdr the first time.
    According to the pacman manual pages, pacman should decide not to overwrite the file, if I have changed the installed ones (in /etc/vdr)
    And finally the question ;-)
    Is there any way to declare the config files in /etc/vdr as "true config files" and handle it, like pacman should do it?
    The PKGBUILD:
    pkgname=vdr
    pkgver=1.3.35
    pkgrel=2
    pkgdesc="A video disk recorder softcam-plugin support"
    url="http://www.cadsoft.de/vdr/"
    #license=""
    #depends=(libjpeg)
    #makedepends=()
    #conflicts=()
    #replaces=()
    #backup=()
    #install=
    source=(ftp://ftp.cadsoft.de/vdr/Developer/$pkgname-$pkgver.tar.bz2
    ci.h.patch
    dvbdevice.c.patch
    pat.c.patch
    sclink.h.patch)
    md5sums=('c47d505bdf30bed26f6e82a47bb39b98' 'e97f8f07f4465b767c1159f13778d1b3'
    '5169351e752ed42b96355235fb7ca1cc' '387a7c7c56c9b6bf9e98889994a3f159'
    '3f7bab8b80f440a5ab88453bd4b89b84')
    build() {
    cd $startdir/src/$pkgname-$pkgver
    patch -Np1 -i $startdir/src/ci.h.patch || return 1
    patch -Np1 -i $startdir/src/dvbdevice.c.patch || return 1
    patch -Np1 -i $startdir/src/pat.c.patch || return 1
    patch -Np1 -i $startdir/src/sclink.h.patch || return 1
    make NO_KBD=1 || return 1
    make plugins
    make BINDIR=$startdir/pkg/usr/bin/ MANDIR=$startdir/pkg/usr/man/ VIDEODIR=$startdir/pkg/mnt/vdr-recordings/ install
    mkdir -p $startdir/pkg/etc/vdr/plugins
    mkdir -p $startdir/pkg/usr/lib/vdr
    cd $startdir/pkg/mnt/vdr-recordings/
    install -D -m644 ca.conf $startdir/pkg/etc/vdr/ca.conf
    install -D -m644 channels.conf $startdir/pkg/etc/vdr/channels.conf
    install -D -m644 diseqc.conf $startdir/pkg/etc/vdr/diseqc.conf
    install -D -m644 keymacros.conf $startdir/pkg/etc/vdr/keymacros.conf
    install -D -m644 sources.conf $startdir/pkg/etc/vdr/sources.conf
    install -D -m644 svdrphosts.conf $startdir/pkg/etc/vdr/svdrphosts.conf
    rm ca.conf channels.conf diseqc.conf keymacros.conf sources.conf svdrphosts.conf
    cd /usr/src/
    rm -rf $pkgname-$pkgver/
    mkdir -p $pkgname-$pkgver/
    cp -r $startdir/src/$pkgname-$pkgver/* $pkgname-$pkgver/
    rm -f vdr
    ln -s $pkgname-$pkgver vdr
    Thanks for your answers 
    Greetings
    Flasher

    You need to use the backup field.
    List the config files you don't want pacman to overwrite:
    backup=(etc/vdr/configfile1 etc/vdr/configfile2)
    And do not put the leading /  because it won't work.

  • Upgrading Controller and Config Files

    Hello,
    I am upgrading my 4402 controller from 4.1.171.0 to 4.2.130. It says I need to save my current config because it will get dumped when I do the upgrade. What extension type do I save the config files as? It does not state this anywhere...
    Cisco sure doesn't make this process very easy. Save config file. Upgrade code. Download saved config file to controller. Hope nothing gets corrupted with all that and hope everything is re-enabled and configured like it was before upgrade? Seems like a lot can go wrong...

    Jerome,
    This is from the 4.2.112.0 release notes:
    In controller software 4.2, the controller's bootup configuration file is stored in an Extensible Markup
    Language (XML) format rather than in binary format. Therefore, you cannot download a binary
    configuration file onto a controller running software release 4.2. However, when you upgrade a
    controller from a previous software release to 4.2, the configuration file is migrated and converted to
    XML.
    This conflicts with what Cisco states earlier in their documentation. I thought when you upgrade it wipes everything and you loser your current config? After reading this section I gather that I only lose the running config and that it will upgrade the config stored in NVRAM? That all makes a lot more sense than what they say earlier in the guide. Once I do the upgrade I can't impor the old config due to it being in the wrong format.
    So in closing this mess my take is that I just need to upload the new software image to the controller. It will load the new software version and then convert the existing config in NVRAM into the new .xml format? Yes?

  • How do you make a form and upload files?

    i would kind of like a mini form, like failblog has. they have a pic, and then some comments, how do you do that? i don't need them to log in or anything, i'll just have a name section, then the comment area.
    also how do you have users upload files?
    even though i'm doing this for a class project, i'd like to do this part, to make it look more real. anyway, i want to have a form, i guess with name, e-mail, then i want them to be able to upload a file, but how do you do the uploading part?

    i would kind of like a mini form, like failblog has. they have a pic, and then some comments, how do you do that? i don't need them to log in or anything, i'll just have a name section, then the comment area.
    If your web server supports PHP, you'll find what you need at Gentle Source.
    http://www.gentlesource.com/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • About Forms and Help Files

    Hi to all
    I use Oracle Forms Builder 10g.
    Support this version a system help based on chm files ?
    Thank You and Best Regards
    Gaetano

    See
    http://ourworld.compuserve.com/homepages/Peter_Koletzke/tip.htm#formhelp

  • How do you handle long strings between JSP forms and Oracle?

    I am using Apache 1.3.12 with JServ 1.1 and Oracle 8.0.4 on NT4 development Server.
    I am developing an application where one component allows authors to contribute articles or comments via a JSP page. I am noticing a problem when the info in the form gets too long (> 2000 characters). 99% of the inserts fall well within this limitation. The remaining 1% is sufficiently significant that I can't use a VARCHAR. It seems that SQL*NET chokes on large strings.
    My immediate workaround for these messages is to break them up into segments. Instead of storing the text or a message directly in a message table, I've added another table, msg_text, with columns msg_id, seg_num, and seg_text. On insert the message is split into segments limited to the smaller of the query limit and database varchar limit, minus the overhead of the sql query. This makes for an ugly insert operation, though and I would very interested to see if anyone out there has a better way to accomplish this task directly with CLOBs.

    The apparent problem with LONGs is that, of course, you can only have one per table.
    I had exactly this problem and ended up with several tables for one Business Entity, which is not really satisfactory.
    For the next phase of the Project, I will investigate:
    Putting these tables into a View.
    Putting Instead Of triggers on the View to "synchronise" changes to all underlying tables.
    Basing my BC4J Entity Object on the View...
    ... and I hope that Bob will be my uncle.
    I'd be interested to hear from anyone who has already tried this, or you if you give it a go.
    Rich

  • Printing alert message in a jsp form a common file.

    Hi all,
    I have a file in which i have to print an alert message. Now the contents of the alert msg are in a common file with the extension" .properties ". in this .properties file the msg that has to be printed is kept in the following manner
    errors.abc.trialMsg=Hi.
    so now i have to do something like this
    alert("Hi");
    except that it cant bee hard coded in the jsp itself but has to be as a constant in the .properties file.
    something like alert(errors.abc.trialMsg);
    but im not sure what should be the correct syntax for it to work....cud someone help me.

    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
    <fmt:message key="errors.abc.trialMsg"/>Pozz
    Rale

  • Where do i find form and action java files

    I was trying to add a new menuitem to the web console. I have a jsp page like pag1.jsp and has pageForm and pageAction java file. Inside struct.config file I find that form and action files are placed under"com.thortech.xl.webclient.actions.tcAddCommentForm" , but when I search for the tcAddCommentForm, I coundn't find the file. Can u tell me where should I add my form And Action files

    Just what to you mean? The Info pane for the iPod in iTunes allows you to sync the iPod contacts and calendar with other calendars and contacts. There is no contacts or calendar in iTunes.

  • Adobe acrobat reader 9 problem saving forms and copying photos

    I used adobe acrobat reader 6 at
    work and I have a form that I save with new data. I am also able to copy text and photos using version 6.
    When I try to save edited forms and copy files from versiion 9 It wont allow me to do that.
    Is their any way that I can copy text, photos and save forms in Adobe version 9?
    When I try to save forms in version 9 it states that I am unable to save the form. When I try to copy text or photos it will not allow me to copy.

    Are you talking about Reader or Acrobat. These are two different programs and Reader definitely has restrictions. Reader used to be called Acrobat Reader before version 6, but that has been gone a long time. The change was likely because of the confusion between Acrobat and Reader. The problems you indicate are suggestive of Reader, not of Acrobat.

Maybe you are looking for