Simple struts example but it doesn't work

Hello everybody,
I'm new in struts technology and I wanted try a simple struts example, but it didn't work. Here are listings of code:
*** struts-config .xml (is located in WEB-INF/) :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
<form-beans>
<form-bean name="registerForm" type="app.RegisterForm"/>
</form-beans>
<action-mappings>
<action path="/register"
type="app.RegisterAction"
name="registerForm">
<forward name="success" path="/success.html"/>
<forward name="failure" path="/failure.html"/>
</action>
</action-mappings>
</struts-config>
*** RegisterAction.java (located in WEB-INF/classes/app):
package app;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import java.io.*;
public class RegisterAction extends Action {
     public ActionForward perform(ActionMapping mapping, ActionForm form,
               HttpServletRequest req, HttpServletResponse res) {
          // b Cast the form to the RegisterForm
          RegisterForm rf = (RegisterForm) form;
          String username = rf.getUsername();
          String password1 = rf.getPassword1();
          String password2 = rf.getPassword2();
          // c Apply business logic
          if (password1.equals(password2)) {
               return mapping.findForward("success");
          // E Return ActionForward for failure
          return mapping.findForward("failure");
*** RegisterForm.java (located in WEB-INF/classes/app):
package app;
import org.apache.struts.action.*;
public class RegisterForm extends ActionForm {
protected String username;
protected String password1;
protected String password2;
public String getUsername() {return this.username;};
public String getPassword1() {return this.password1;};
public String getPassword2() {return this.password2;};
public void setUsername(String username) {this.username = username;};
public void setPassword1(String password) {this.password1 = password;};
public void setPassword2(String password) {this.password2 = password;};
*** faulire.html ( located webapps/NAME_APPLICATION/ )
<HTML>
<HEAD>
<TITLE>FAILURE</TITLE>
</HEAD>
<BODY>
Registration failed!
<P>try again?</P>
</BODY>
</HTML>
*** success.html ( located webapps/NAME_APPLICATION/ )
<HTML>
<HEAD>
<TITLE>SUCCESS</TITLE>
</HEAD>
<BODY>
Registration succeeded!
<P>try another?</P>
</BODY>
</HTML>
*** register.jsp ( located webapps/NAME_APPLICATION/ )
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:form action="register.do">
UserName:<html:text property="username"/><br>
enter password:<html:password property="password1"/><br>
re-enter password:<html:password property="password2"/><br>
<html:submit value="Register"/>
</html:form>
*** web.xml (located in WEB-INF/)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
     org.apache.struts.action.ActionServlet
     </servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
</web-app>
After start of NAME_APPLICATION it show register form (register.jsp) but when I fill out all information and submit those information it show empty window in internet browser and in url box is something like this:
http://localhost:8084/StrutsTest/register.do;jsessionid=2304C0A9820E7FCC23106C16564D51A8
where is a problem? Thank you

Employing a descendent of the Action class that does not implement the perform() method while using the Struts 1.0 libraries. Struts 1.1 Action child classes started using execute() rather than perform(), but is backwards compatible and supports the perform() method. However, if you write an Action-descended class for Struts 1.1 with an execute() method and try to run it in Struts 1.0, you will get this "Document contained no data" error message in Netscape or a completely empty (no HTML whatsoever) page rendered in Microsoft Internet Explorer.
Also check this URL http://www.geocities.com/Colosseum/Field/7217/SW/struts/errors.html

Similar Messages

  • MY IPOD APPEARS TO BE ZOOMED INTO THE SCREEN AT ALL TIMES, MAKING IT DIFFICULT TO DO SIMPLE TASKS SUCH AS GO BACK, OR SELECT A PLAYLIST, ETC. I'VE TRIED PULLING IT OUT WITH MY FINGERS BUT THAT DOESN'T WORK. PLEASE CAN YOU HELP!!! THANKS.

    I've got a touch iPod and for about a week now it's almost been permenently zoomed into the screen? I actually cannot get it to zoom back out. I've tried pulling the screen out with my fingers but that doesn't work. It's zoomed in on my home pages, on my music, settings everything! It makes simple things like deleting a number from my password login extreamly differcult. Please can someone help?!?! Thanks.

    Double tap the screen with three fingers to un-zoom.
    Then go to Settings > General > Accessibility > Zoom and turn this OFF.

  • Simple drag&drop with handler doesn't work in Edge?

    Hi all!
    I made this very simple example of Drag&Drop in Edge: http://www.terredainventare.it/simpledrag/simpledrag.html using Jquery Ui http://docs.jquery.com/UI/Draggable.
    I try to use the JQueryUi "handle" property that makes you drag an object restricting drag click on only one element but it doesn't work.
    Here's the code I've put in Edge onCompositionReady:
    sym.$("drag").draggable({ handle:"handler" });
    Of course my two Div-elements are called "drag" and "handler". Now the drag works only on the "wrong" element and not on the "handle".....
    Here's the Adobe Edge files: http://www.terredainventare.it/simpledrag/web.zip
    Many thanks in advance for your help!
    Davide

    So, on stage i add a rectangle named "drag" and i try this code:
    yepnope({
                nope:[
                'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js',
                'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css'
                complete: init
    function init() {
             //$("#Stage_drag").draggable();
             //$(sym.lookupSelector("drag")).draggable();
             sym.$("drag").draggable();
    3 lines work: $("#Stage_drag").draggable() or $(sym.lookupSelector("drag")).draggable() or sym.$("drag").draggable()
    And css file is not required.
    Well, your dowload link is not perfect but i download your folder. See you later.
    There is a tutorial: a movie tutorial (adobe tv). Mix it baby! Extending Edge Animate 02:57
    They use: yepnope (both, callback)
    yepnope({
         both: ['jquery-ui.min.js',
                   'jquery-ui.css'
         callback: function(){sym.$("drag").draggable()}
    I will send you your files tomorrow (private message).

  • I am connected to wifi but Internet doesn't work.

    I am connected to wifi but Internet doesn't work. Software updated and settings reset. Still no luck. I pod touch

    Despite the connection indication you may not really be connected to your WiFi network.
    Your router may not have given your iPod a valid IP address. To check on this go to Settings > Wifi > your network name and touch the ">" to the right to see the network details. If the IP address shown starts with 169 or is blank then your router didn't provide an IP address and you won't be able to access the Internet.
    Sometimes the fix for this can be as simple as restarting your router (remove power for 30 seconds and restart). Next, reset network settings on your iPod (Settings > General > Reset > Reset network settings) and then attempt to connect. In other cases it might be necessary to update the router's firmware with the latest from the manufacturer's support web pages.
    If you need more help please give more details on your network, i.e., your router make, model and version, the wifi security being used (WEP, WPA, WPA2), etc.

  • Mac connects to wifi, but internet doesn't work. Network diagnostics shows problem starts at ISP. All software is updated and all other devices are able to effectively use the wifi source.

    Mac connects to wifi, but internet doesn't work. Network diagnostics shows problem starts at ISP. All software is updated and all other devices are able to effectively use the wifi source.

    Hi, KK93. 
    Sometimes a simple power cycle of the router and Mac can resolve the issue.  However, try the steps in the article below to troubleshoot the Wi-Fi issue with your MacBook.
    Troubleshooting Wi-Fi issues in OS X
    http://support.apple.com/kb/HT4628
    Also, see the article below to make sure the router setting have been optimized for performance.
    iOS and OS X: Recommended settings for Wi-Fi routers and access points
    http://support.apple.com/kb/HT4199
    Cheers,
    Jason

  • I bought a mini DVI to HDMI convertor and  a HDMI to VGA cable to connect my mac book pro to a tv but it doesn't work any one can help.\\\\\

    i bought a mini DVI to HDMI convertor and  a HDMI to VGA cable to connect my mac book pro to a tv but it doesn't work any one can help.

    I would suggest looking into a Thunderbolt to HDMI connector. In this case, you may be able to use the TV as an external monitor. For this option, please confirm through additional research. I have not tested it personally.
    You can also use an Apple TV, which connects with HDMI. In this case, you can use Airplay Mirroring. Not all Macs support Airplay Mirroring, so you need to check first. I have a Mid-2011 27" iMac, and it supports Airplay Mirroring. I don't use it often because my TV is in another room, but I just tried it and it worked. It had to change the screen resolution to work well, so I don't know if I would want to use it as my day to day monitor. http://support.apple.com/kb/ht5404

  • I can't seem to get my iMac (late 2009 model) into automatic sleep mode.  If I manually put it into sleep I don't have any issues.  I used to solve the issue by running "PleaseSleep" application but that doesn't work anymore since Lion.

    I can't seem to get my iMac (late 2009 model) into automatic sleep mode.  If I manually put it into sleep I don't have any issues.
    I used to solve the issue by running "PleaseSleep" application but that doesn't work anymore since Lion. I now want to fix the underlying problem.
    I'm not running any weird background processes and in my energy saver settings I've tagged "put the hard disk to sleep when possible:, "allow power button to put computer to sleep" and "automatically reduce brigthness". All pretty standard.
    Is there anyone who can give me some pointers ?

    Today I solved the same problem for my iMac running Snow Leopard. See https://discussions.apple.com/thread/3008791#15947706. The method may help you, too.
    For me it was the DynDNS Updater preventing my iMac from automatically entering sleep mode.
    To my knowledge the cause of this sleep problem can only be a peripheral device or a process. So I suggest to first unplug all peripherals and test whether that's the cause. If not, I suggest to terminate one process after another and to test automatic entering of sleep mode after each. Start with user processes; continue with system process if necessary.
    At least that's the way I found the offending process. Fortunately, I was able to change the configuration of that process to allow again automatic entering of sleep mode.
    Good luck!

  • My phone is stuck on apple screen and i've tried to reboot it and connect it to my computer many times but it doesn't work.  Can anybody help me?

    My phone is stuck on apple screen and i've tried to reboot it and connect it to my computer many times but it doesn't work.  Can anybody help me?

    This is covered in the basics section of the manual:
    iPhone User Guide (For iOS 5.0 Software)

  • I would like to copy all the songs from one Ipod into another. All the songs are into my Itunes account, I tried to drag and drop the songs from the old Ipod to the new one but it doesn't work. Is there a way to do it ?

    Hello everybody,
    I would like to copy all the songs from one Ipod into another. All the songs are into my Itunes account, I tried to drag and drop the songs from the old Ipod to the new one but it doesn't work. Is there a way to do it ?
    I share one Itunes account with other people from my family and one person would like to keep the same songs on the new Ipod as the ones which were on the old one.
    Thanks in advance for your answer.
    Yan

    Hello Chris,
    Thanks for your answer. I was hoping for an easier answer. Too bad there is no drag and drop solution, it would have been much easier.
    Thanks for answering so fast.
    Bye.
    Yan

  • In my iTunes on the iPad I've got 95 items that are stuck and I tried swiping them to delete them but it doesn't work dose any one know how to empty the download tab

    In my iTunes on the iPad I've got 95 things that are stuck and I tried swiping them to delete them but it doesn't work dose any one know how to empty the download tab

    Thanks, but, using the "free" version of Reader, there is no opportunity to open nor import the xml data - the menu options do not exist - there is no import listed.
    If we try to open the xml file directly, then we get an error - something to the effect of "unsupported file type, or the file is corrupted".
    I just noticed in my Pro version that there is the command File ->Form Data ->Import Data to Form... command. Is this what you are referring to?
    What do you recommend? Perhaps the easiest thing to do would be to purchase a few copies of Acrobat Pro for the reservations people to use? I was hoping that the free version of reader would do it, but perhaps not?
    Thanks again,
    Rob

  • I followed the instructions for restoring bookmarks from an older Firfox to a new one but it doesn't work.

    I'm trying to get my old bookmarks installed with Firefox on a drive holding Win xp to Firfox installed on a different drive holding Win 7. I followed the backup and restore process in the Firefox help file but it doesn't work. Help will be appreciated because I have a slew of bookmarks that I would like to use with Win 7.

    If you need to merge bookmarks then you need to export the bookmarks to an HTML file and import that file on the other computer.
    Bookmarks > Organize Bookmarks > Import & Backup > Export HTML
    Bookmarks > Organize Bookmarks > Import & Backup > Import HTML : "From File"
    See also http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox

  • HT5622 The Game Center used to work with my Apple ID before I updated to iOS 7.4, I used to play multiple player with EA Real Racing 3 game but it doesn't work at all and every time I tried to go to the Game Center it's just blank, even to the settings no

    The Game Center used to work with my Apple ID before I updated to iOS 7.4, I used to play multiple player with EA Real Racing 3 game but it doesn't work at all and every time I tried to go to the Game Center it's just blank, even to the settings nothing!

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Go to Settings>Game Center and sign out and sign back in
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                                
    iOS: How to back up                                                                                     
    - Restore to factory settings/new iOS device.             

  • How can I add a new Template to My Templates in Pages? I've read most of the discussions on the subject but it doesn't work for me. By the time I reach the Templates folder, I only see templates for Numbers and not for Pages. Need help, please.  Thanks

    How can I add a new Template to My Templates in Pages? I've read most of the discussions on the subject but it doesn't work for me. By the time I reach the Templates folder, I only see templates for Numbers and not for Pages. Need help, please.  Thanks

    Si vous avez utilisé la commande Save As Template depuis Pages, il y a forcément un dossier
    iWork > Pages
    contenant Templates > My Templates
    comme il y a un dossier
    iWork > Numbers
    contenant Templates > My Templates
    Depuis le Finder, tapez cmd + f
    puis configurez la recherche comme sur cette recopie d'écran.
    puis lancez la recherche.
    Ainsi, vous allez trouver vos modèles personnalisés dans leur dossier.
    Chez moi, il y en a une kyrielle en dehors des dossiers standards parce que je renomme wxcvb.template quasiment tous mes documents Pages et wxcvb.nmbtemplate à peu près tous mes documents Numbers.
    Ainsi, quand je travaille sur un document, je ne suis pas ralenti par Autosave.
    Désolé mais je ne répondrai plus avant demain.
    Pour moi il est temps de dormir.
    Yvan KOENIG (VALLAURIS, France)  mercredi 23 janvier 2011 22:39:28
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • IMac 24" iMac  (iMac7,1), Intel Core 2 Duo 2,8 GHz  Ram 4 MB running OS 10.6.8: impossible upgrade to Mac OSX Mavericks. Already created second account, according to apple online support, but still doesn't work. Thanks for help.

    iMac 24" iMac  (iMac7,1), Intel Core 2 Duo 2,8 GHz  Ram 4 MB running OS 10.6.8: impossible upgrade to Mac OSX Mavericks. Already created second account, according to apple online support, but still doesn't work. Thanks for help.

    Your Mac is definitely one of the supported models? http://www.apple.com/uk/osx/specs/
    If so, what happens when you try to download? Is it a case of nothing happens? If so, take a look at the suggestions under 'Stalled Download' in this link:
    http://www.wired.com/gadgetlab/2013/10/mavericks-issues-and-fixes/#slideid-23477 1
    Also, some usrs have found that logging out of the Mac App Store and then back in again and starting over has kick-started the download. It seems that the 5+gb download can take a long time to give any feedback as to what's happening.

  • Help! I have had my iMac G5 fitted with new Logic Board but it doesn't work

    Help! I have had my iMac G5 fitted with new Logic Board but it doesn't work
    I have just had my iMac G5 First Gen 1.8Ghz fitted with a new Logic Board under the Apple Repair Extension Programme for iMacs.
    I got the iMac home from the repairers and switched it on and everything was working fine for about 2 hours and then all of a sudden the Error Page came up on the Screen (with a big On/Off Switch Logo) and it said I had to shut down.
    So I shut it down waited a few minutes and then tried to re-boot it but nothing happened. All that happended was the Power Light in the Right hand corner came on..but nothing else....
    Help! Any ideas what to do please?

    If you have an external firewire drive (it has to be firewire, USB won't boot on a Rev A), plug it in to the firewire port and turn it on, then boot your iMac and see if it shows on the screen.
    Have you tried to hit the eject (up arrow, the last button on the top row of the keyboard) button when you boot, perhaps the repairers left a disc in the drive? Then try and put your install disc in.
    Miriam

Maybe you are looking for