Stupid newbie question

I am trying to learn JSP. To that end, I use published code to learn the syntax. One set of code is the following:
NameHandler.java
package hello;
public class NameHandler {
    private String username;
    public NameHandler() {
        username = null;
    public void setUsername( String name ) {
        username = name;
          public String getUsername() {
        return username;
hellouser.jsp
<%@ page import="hello.NameHandler" %>
<jsp:useBean id="mybean" scope="page" class="hello.NameHandler" />
<jsp:setProperty name="mybean" property="*" />
<html>
<head><title>Hello, User</title></head>
<body bgcolor="#ffffff" background="background.gif">
<%@ include file="dukebanner.html" %>
<table border="0" width="700">
<tr>
<td width="150">   </td>
<td width="550">
<h1>My name is Duke. What's yours?</h1>
</td>
</tr>
<tr>
<td width="150"   </td>
<td width="550">
<form method="get">
<input type="text" name="username" size="25">
<br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</td>
</tr>
</form>
</table>
<%
    if ( request.getParameter("username") != null ) {
%>
<%@ include file="response.jsp" %>
<%
%>
</body>
</html>There are three other files, but the problem is not necessarily with the other parts. I compiled the java file and have both the .java and .class file in the same folder. I then packaged the site and uploaded it to my hosting site. When I try to run hellouser.jsp, I get the following error:
The value for the useBean class attribute hello.NameHandler is invalid
Now, I did try to find out what the error means on the Internet, but I got somewhat confused. There was suggestions of changing scope to type in the header of the .jsp file. Others suggested declaring a public default constructor. Since I am a newbie to Java and JSP program, I am not exactly sure what that is. Also, the site that published this code had very specific places for folders and their contents for the file to be run. Sadly, I can't exactly copy this structure. How can I tell the code to find the resources it is looking for?
Thank you for your time.

Hello,
you have not included code where you are actually using the bean, something like
username = request.getParameter("username");
mybean.setUsername(username);If you want this bean to be available to all pages in the application change the scope to session
<jsp:useBean id="mybean" scope="session" class="hello.NameHandler" />Sometimes when adding a new class such as NameHandler you need to restart the web server for it to be detected.
Regarding the constructor, you need a "zero argument constructor", which you have done, i.e. there are no parameters in the brackets for NameHandler().
Instead of using null you could try initialising the variable with
private String username = "";but I dont think the problem lies with your class, more likely to be the way you are trying to use it within the JSP

Similar Messages

  • Probably a stupid Newb question....chkconfig

    Hi all,
    This is a very nice distro, especially if you wanted to learn linux, not just use it with a pretty GUI, and it has met ( sometimes exceeded ) my expectations.
    The searching the forums, using google extensively, the wiki have made the experience most worthwhile.  The first distro was mandrake, which lasted about 1 month because I could not learn anything with it.  Anyway on to the question at hand.   
        What is the Arch linux equivalent of chkconfig?  Or does one have to download the package itself via pacman?
    The reason I ask is that I would like to turn off all unneeded services ( I am a bit of a security hound, at least with a windows box ).   The Linux box will just be a workstation for myself, to do email, web surfing, maybe some online buying and eventually development.   No remote access to the machine is needed for myself ( as it is off, when I am not using it ).
    Hopefully, I phrased the question correctly!   
    Thanks,
    BobL

    BobL wrote:
    Thanks for the follow up Phrakture.   However, I did not quite follow when you said that chkconfig is a wrapper for make calls.   I thought it merely listed running services.   I did check on the make command and I cannot find how chkconfig even relates to what you mentioned.   Then again the article was mentioned in the context of a RedHat article.  So perhaps I am switching terms between different distrubutions....probably not a good idea. 
    I do know what "wrapping" is...with the programming background I have, I just didn't follow your context.
    oh, crap - I mixed it up with checkinstall... my fault  :oops:  :oops:  :oops:

  • Stupid newbie question for A1

    How do I use my tablet as a mobile phone

    hi tathraman,
    If you have a WiFi only tablet, you can try to use apps like Viber, Textplus, or similar to call or send messages. Textplus lets you send free text messages to any mobile phone number in US/Canada.
    Best regards,
    neokenchi
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Sorry for the stupid newb questions, don't want to make a bad buy

    and I am pretty much an idiot when it comes to technology.
    Here's what I am looking for. Hopefully, one of you kind souls who are far smarter than I am, can point me in the right direction.
    I want an MP3 player for working out. I would really like it to be able to do the following:
    -shuffle playlists I add in without always going through the same songs in the same order.
    -be able to be used with an armband, or at the very least, a belt clip. (definitely prefer armband though)
    -hold enough music to be able to get me through about 2 hours worth of working out.
    -be able to withstand a fair amount of shock and wear and tear, as I also do martial arts training. (no, I am not going to try to cleave anyone with it)
    One of the things I kept noticing when trying to read through specs, was the listed bit rates for songs in MP3 format. Virtually everything I have is at 320, but the highest I've seen listed is 28.
    I'm assuming it will still work, but I wanted to make absolutely sure because I would get extremely frustrated to find out I had to redo a rather huge collection of music.
    I was looking at Creative NOMAD? MuVo? 2 as a logical choice, but I wanted to see if I could get an expert opinion on what might be better. Is 52MB going to be enough machine for what I want, or do I need to look at something in the GB and up dept. Also, how much of a beating will it take? Is there a better choice, even if it costs more money?
    Also, are the players that start at like 5GB pretty bulky? I would think they would be, which is a big cause for concern. I have enough trouble lifting my weights, without worrying about cramping up while trying to lug a piece of Samsonite filled with melodic electrons. Any input would be greatly appreciated.
    Thanks for your help.

    If you're expecting the player to be bumped around I would strongly suggest you get a flash player. The largest you can get is Gb (I think either the MuVo N200 or V200), and you've already mentioned the MuVo? 52Mb player which is equally good. Not sure sure if the MuVo N200/V200 shuffle, but I'm sure the MuVo? does.
    All Creative players will play 320 kbit/s, this is the highest rate you can encode at for MP3/WMA.

  • Probably a Stupid Newbie Question, but....

    Picked up a 8300 series Curve a couple of weeks ago.  Had it synched with my Outlook on my pc.  About a week ago the synch stopped working and I noticed that when the phone was plugged into the USB cord the little charger symbol would only stay lit up for about 7 seconds before disappearing.  On the Desktop Manager screen its says "Device Connected: (PIN): None"  Thinking it was perhaps a faulty USB cord (after unplugging and restarting it several times) I bought a new USB Cord, and now the charger symbol won't even light up and it remains "Device Connected: (PIN): None" 
    Wondering if anyone has any suggestions?
    Thanks

    First off, I would suggest uninstalling and reinstalling Desktop Manager.
    http://www.blackberryforums.com/rim-software/25937-how-perform-clean-uninstall-reinstall-blackberry-...
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Stupid Newbie Question-Sending STP back to FCP

    So, I send my FCP 6 project to a STP multitrack project. I do some mixing, add sound effects, etc.
    Now what? How do I get it back into FCP? Do I even bother? Should I export the audio as AC3 in STP and the video as MPEG-2 and join the two streams in the DVD creator?

    First, I duplicate the timeline in FCP so that I keep a timeline intact with original audio. Once I finish my work in STP, I export the mix as an aiff. I bring that aiff into my duplicated timeline in FCP and use it to completely replace the audio in that timeline. There's no way to maintain a multi track project going from FCP to STP and back again. Should you need to open the aiff file in FCP, STP will open the multi track project you originally started with.

  • Stupid newbie question camera card readers

    Hello, Well I just purchased a G5 and now I'm ready to open the box. But I want to know if the computer has built in camera memory card reader. I'm not finding anything on the box or under specifications on the website. I don't want to open the box if it does not have a card reader - might need to return the unit without a re-stocking fee. So does a PowerPC G5 iMac have a built in reader? Or do I need an outboard reader?
    Thanks
    G5   Mac OS X (10.4.5)  

    Welcome to the discussions!
    You might have wanted to look into this before you tied up that kind of cash.
    No Mac of any model or generation has a built-in card reader. All Macs have plenty of USB ports to attach a camera or USB card reader to.
    Don't let this be a deal breaker. If you are switching, Macs have a lot to offer, even if they don't have a card reader.

  • Stupid newbie question here: When setting up for hot sync, both PC and smartphone will ask for "device name" but how do I know which devide I'm naming? If I'm on the phone, do I specify the phone or the computer; and vice versa.

    null
    Post relates to: Treo 680 (AT&T)

    Hello and thank you for using the Palm Help Forums!
    It's more like naming the partnership. By "naming" your device is doesn't do anything harmful. If you name it Pat's Treo, when syncing it tot he computer, hotsync will say "Syncing with Pat's Treo." You can name your device Fido for all it matters.
    Post relates to: Treo 800w (Sprint)

  • Total Newbie Question ... Sorry :-(

    I know it's a windows thing, and I am now converted to Mac but I gotta know this because it's doing my head in. It's a complete stupid green gilled newbie question.
    When installing new programs on a Mac can you create shortcuts to the programs on the Dock? I did what I THOUGHT it would be, i.e I made an Alias and stuck it in the dock, but on rebooting my Mac later on, in place of the shortcuts where 3 question marks which when clicked on did absolutely nothing???
    Help?
    A.L.I
    Windows XP Pro Desktop, Macbook Pro, 60GB iPod Video   Mac OS X (10.4.5)   OS X

    You aren't installing something from a dmg file are you? The dmg is a disk image – kind of a virtual CD. So when you double click the dmg and then get the little disk/hardrive/custom icon on your desktop that is the same as if you had mounted a CD. You then need to drag the application off of that "CD" into your application folder. Then it is truly installed.
    You can then "eject" the icon your your desktop. This is what happens when you shutdown and without remounting the image your dock shortcut can't find the original.
    Just a thought.

  • Newbie Question. just installed IE7.. how do I set up a local host to preview sites?

    Sorry for the newbie question... but it's been a long time since I have done this
    Thanks!

    Just define your site in DW as always.  For a static site, that's all you need to do.

  • Newbie Question about FM 8 and Acrobat Pro 9

    Hello:
    I have some dcouments that I've written in FM v8.0p277. I print them to PDF so that I can have a copy to include on a CD and I also print some hard copies.
    My newbie question is whether there is a way to create a  PDF for hard copy where I mainitain the colors in photos and figures but that the text that is hyperlinked doesn't appear as blue. I want to keep the links live within the soft copy. Is there something I can change within Frame or with Acrobat?
    TIA,
    Kimberly

    Kimberly,
    How comes the text is blue in the first place? I guess the cross-reference formats use some character format which makes them blue? There are many options:
    Temporarily change the color definition for the color used in the cross-reference format to black.
    Temporarily change the character format to not use that color.
    Temporarily change the cross-reference definition to not used that character format.
    Whichever method you choose, I would create a separate document with the changed format setting and import those format into your book, create the PDF and then import the same format from the official template.
    - Michael

  • Domain name settings - Newbie question

    Sorry for a newbie question!
    I am already pointing a domain name to web hosting for email account. Now, I need an application server to run ERP software and Oracle, and installing Solaris and Oracle need a domain name.
    If I point my domain name to the server, how do I receive emails from web hosting???
    Install an email server to the application server instead? What can I do if I want the same domain name? Any option?

    Setting up a mailserver and making sure it doesn't suddenly turn into a spambox is not something you do with the use of a few commands. I suggest to dive into the Solaris admin guide on docs.sun.com and read up on e-mail and network services.
    If that is asking too much of your time you'll be better off getting your ISP to handle all this for you.

  • Domain Name settings in Solaris - Newbie question

    Sorry for a newbie question!
    I am already pointing a domain name to web hosting for email account. Now, I need an application server to run ERP software and Oracle, and installing Solaris and Oracle need a domain name.
    If I point my domain name to the server, how do I receive emails from web hosting???
    Install an email server to the application server instead? What can I do if I want the same domain name?

    Your questions are completely off-topic for the forum.
    These SunOS forums are for questions on <i>"how do I install my OS"</i>
    You particular question is in the <i>"how can I install Solaris while using the CD drive"</i> forum.
    So, if you had a question on how to edit the /etc/inet/hosts file to establish a FQDN on the computer, then it might be appropriate for the forum.
    Unfortunately, I don't have a clue on where to redirect you, except perhaps to the Sun Java Enterprise System suite of applications?

  • Newbie Question:  How much computer do I need?

    Newbie Question:
    I would like to use MainStage 3 in a live performance environment to play bars, parties, etc.  I'm not looping, using it to playback recordings, processing outboard equipment or vocal processing.  I want to stop carrying Rolands, Nords, Korgs, etc and get to a controller and a rack with a Mac Mini in it.
    I tested a download of Mainstage 3 on my home Mac Mini (late 2012, 3.5 Ghz i5, 4GB RAM, 500GB drive) and it seemed to run fairly well.  $30 well invested so I trekked forward... I purchased a Mac Mini (late 2009,  2.52GHz Core 2 Duo, 6GB RAM, 128GB SSD) for $200.  I started to do more elaborate keyboard setups to see how the CPU would hold up.  It typically runs from 30% to 50% of capacity (CPU and Memory)  It actually boots and runs better than the i5.  I hear the occasion gitch, but it actually seems to be getting better in time (or I'm rock and roll deaf.
    I got a rack, an Airport Express, a Radial USB interface and a Nektar Panorama P6.  It's starting to get expensive, but I'm emboldened by the actual quality for the sound and the flexibility of arranging for live performance.  What used to take me two and three keyboards to play, I can now fit on one performance patch.
    OK, now the question... am I at the limits of this little Core 2 Duo?  Should I upgrade the i5 with more RAM and a bigger SSD and use that?  Should I get a new(er) i7 and bite the $1,500 bullet for the additional RAM and SSD?
    I see that most of you are running pretty nice Macbook Pros with i7 and lots of everything.  My needs are modest; am I OK? 
    BTW, I want to run a Mac Mini in a box because I don't want to carry a laptop out in the open.  If I was doing bigger shows I wouldn't care but I play some rowdy bars and constantly have folks hanging off me while I'm playing.  It's fun, but hard on gear.  If you can't drop it or dip it in beer, it won't last long where I work.
    Matt Donnelly

    Rule of thumb: newer and faster is better. But, depending the complexity of your needs you may be OK with an older Mac. Some glitches that happen in a live performance are due to loss of communication with USB or Firewire inputs, so make sure they're secure. I recently upgraded from a 2010 Mac Mini 2.6 dual core with 16 GB RAM, which was used live for nearly four years, to the latest Mac Mini 3.0 i7 with 16 GB RAM and a 500 GB SSD. I was getting an occasional stuck note with the older one. The new one is rock solid. Some of my patches may have up to a dozen channel strips mapped to three keyboards. The Mini is mounted in a rack next to a MOTU Ultralite Hybrid. It is a good idea to map a panic button on your keyboard to controller # 123(all notes off). Also, you might want to invest in a battery backup power supply(APC, Cyberpower, etc.-$40-$60) to protect your Mac against power loss, which can damage you hard drive.

  • Multiple version of JRE in company..How to manage? (newbie question)

    Greetings..this is a newbie question
    We have 48 versions of JRE running in on XP IE6 in our company.
    Some version beat up other JAVA applications.
    It's a mess.
    How can anyone manage this many versions?
    Can we consolidate down to a few versions?
    I saw some posts on changing the JRE dynamically or perhaps using a wrapper with a product from "sourceforge".
    Are these viable?
    Thanks in advance

    We have 48 versions of JRE running in on XP IE6 in
    our company.
    Some version beat up other JAVA applications.
    It's a mess.can you elaborate on how some versions "beat up" other apps?
    How can anyone manage this many versions?you don't, each computer should periodically upgrade (IMO) but you shouldn't care. if you do, tell your users to load the latest version
    Can we consolidate down to a few versions?sure
    I saw some posts on changing the JRE dynamically or
    perhaps using a wrapper with a product from
    "sourceforge".
    Are these viable?i have no idea what this is, but I have doubts about your problem, if it exists at all

Maybe you are looking for

  • Deleting old messages problem (adapter status 001)

    Hi, I am trying to delete old messages, and some of them are staying in system. Here is the result of 'RSXMB_SHOW_STATUS' report: Message Status Message Status:      003 Number:             85.274 Adapter Status of Messages with Message Status:      

  • Decision for Plant and Purchase Org

    Hi ,, Till time we have single centralized purchase organization but now our client wants to have different procurement departments to handle procurements for different areas. We have suggested them to have different purchase organization for that. B

  • RMAN backup with archivelogs.

    Dear all, Can i delete all archivels after the RMAN backup. Why do we backup archivelogs with RMAN backup. I think it is useless. Please can somebody explane this. Regards upul indika

  • Executable does not release serial port after being stopped

    Greetings: I have created an executable that communicates through a serial port.  However, if I stop the executable (not close it), the executable still has control over the COM port.  This causes issues if I need to jump on Hyperterminal to send a c

  • Pagination disappears after setting 'max row count'

    I have a report with app. 4500 records (with the default of 15 lines per page) and a pagination scheme of 'Row Ranges 1-15 16-30 in select list (with pagination)'. When running the report, all is working fine and i get the information in the select l