"Packages cannot be nested" error in Flex
I want to use SoundFacade class from Adobe. (Here, from github). I simple created an "ActionScript File" and paste all the code. But when I want to compile my app I got following error:
1037: Packages cannot be nested.
The only reason I can guess is that the package must somehow put into the project or something.
Even when I just put a simple empty package I got the error:
package { }
Any idea what is this error about?
Found the solution in the forum: http://forums.adobe.com/message/4299377
Similar Messages
-
1037: Package Cannot Be Nested
Hi --
I ran in to the "1037: Package Cannot Be Nested" error when
using the sample
code in Flash help and found the "How to Use the Examples"
portion of the
Adobe Flash help files to finally get my answer. It appears
to be an issue
many others have come across so I thought I would explain in
more detail how
to solve this problem.
What you need to do is save the ActionScript file as the name
of the class,
for example "MyClass." Then you set the Flash movie "Document
Class"
(FILE-->PUBLISH SETTINGS-->FLASH-->SETTINGS) to
"MyClass." You do not need
to call/refer to/load the ActionScript file in the Flash
movie -- it will do
it automatically for you! Just make sure the FLA and the AS
file are both in
the same directory.
RichRichard,
> I ran in to the "1037: Package Cannot Be Nested" error
when
> using the sample code in Flash help
Ah, good one! Yes, thanks for bringing this up. A number of
the
current 3rd party ActionScript books -- and, as you pointed
out, most of the
sample code in the docs -- is written in the form of class
files. I've
heard from a number of people who have tried to copy/paste
such code into
keyframes, then see the 1037 compiler error.
In ActionScript 3.0, all SWFs have a Document class one way
or the
other. If you don't assign one yourself, such as the
MyClass.as you
mentioned, the SWF will receive a default Document class by
the name of
MainTimeline. Which means the SWF's code is already declared
inside a
package (automatically). The introduction of a second
(seemingly original)
package declaration in timeline code cause those two packages
to be nested,
which is not allowed.
David Stiller
Co-author, Foundation Flash CS3 for Designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design." -
AS3 in Flex - ERROR 1037 Packages cannot be nested
Hi.
I am having some difficulty getting this simple bit of code
working in Flex. It works perfectly in Flash. However in Flex i get
an error 1037, Packages cannot be nested. Can anyone let me know
where im going wrong / how to fix this problem. Thanks. Code
attached.
Barry.This thread should be in the AIR forum. The couple
suggestions Andrei1 is making are correct, but it isn't the reason
why you're getting that error.
When you want to use a class within the declarative
environment of Flex/AIR, you should use a namespace for that class
and instantiate it via MXML or instantiate it within the Script
block via ActionScript. Make sure that the files are in the same
folder and then see if the following works for you.
TS -
Error: Packages cannot be nested
i have the following AS class file:
package {
public class DropImage {
public function DropImage() {
package{
import flash.display.MovieClip;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import com.greensock.TweenNano;
import com.greensock.easing.*;
public class DropImage extends MovieClip {
private var containerArray:Array = new Array ;
private var totalImgs:int = -1;
private var counter:uint = 0;
private var imageLength:uint;
public function DropImage() {
//Loads the xml
var xmlLoader:URLLoader = new URLLoader ;
xmlLoader.load(new URLRequest("DropImages.xml"));
xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
//Creates new instances of the ImageContainer class with the y position
//initally set off the stage and the rotation at -90. The -90 rotation
//gives the dropping effect as the object gets tweened downwards.
private function xmlLoaded(e:Event):void {
var xml:XML = new XML(e.target.data);
imageLength = xml.image.length();
for (var i:int = 0; i < xml.image.length(); i++) {
var imgc:ImageContainer = new ImageContainer(xml.image[i].attribute("src"));
imgc.x = 100;
imgc.y = -133;
imgc.rotation = -90;
imgc.alpha = 0;
imgc.addEventListener("imageloaded",showImage);
addChild(imgc);
containerArray.push(imgc);
//waits for all images before tweening
private function showImage(e:Event):void {
totalImgs++;
if (totalImgs == imageLength - 1) {
tweenBox();
//tweens the images downwards to a randoms rotation between -11 and 11
//and replays the tween after two seconds.
private function tweenBox():void {
TweenNano.to(containerArray[counter],1, {y:192.45,
rotation:Math.floor(Math.random() * 11) - 11,
alpha:1,
ease:Sine.easeOut,
onComplete:function(){
if(counter != containerArray.length - 1){
counter++;
TweenNano.delayedCall(2, tweenBox);
It sais '1037: Packages cannot be nested' and if i click the error it goes to line 7 of the scrip..help please? 3as3 Class files all follow the same general format listed below.
package designation
import statements
the class declaration
class-scoped (ie, not local to a function) variable declarations
the class constructor
other class functions
p.s. that's as3, not as1,as2.
p.p.s. format your code so it's legible. -
Error -- 1037: Packages cannot be nested.
Hi There,
I am using Flash CS3 and ActionScript3.0 for development. I
am trying to run some sample codes from Adobe site [and also from
Flash Help, copied directly] but on compiling it throws "1037:
Packages cannot be nested.". I m totally clueless... my only
assumption is... this might be a Flash/Environment setting issue.
Even if it is an Env issue... how to resolve it? Any help!!
Thanks in Advance,
Siraj Khan
[email protected]
// Code AttachedThe example code in the online help is horribly inconsistent.
The example that you site is meant to be pasted into an .as
external file. If you want to use this code in an actionscript
frame space then you'll have to de-package the code. Look at my
example. You have to remove the package wrapper and the sprite
extension wrapper. Then remove the "Public" and "private" prefixes
from the functions. Finally you have to call the first
function. -
Packages cannot be nested : 1037 Error!!
Hi There,
I have this problem with CS3, and I dont know if there are
any settings and stuff. When I do something like the code attached
I get "1037: packages cannot be nested". If I remove the package
and the braces, i get "classes cannot be nested", but sometimes the
Adobe Flash Class help Examples work. When I create a class and
package, this problem occurs. its quite wierd. And Im not a CS3
Enthusiast yet, so please forgive me if its some silly mistake
somewhere.This belongs in an external .as file, not anywhere on the
timeline. -
I'm a newbie and have started a simple tabbed mobile project.
I keep getting "packages cannot be nested".
my main mxml file:
<?xml version="1.0" encoding="utf-8"?>
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script source="cBut/cFields.as">
</fx:Script>
<s:ViewNavigator label="Results" width="100%" height="100%" firstView="views.ResultsView"/>
<s:ViewNavigator label="Setup" width="100%" height="100%" firstView="views.SetupView"/>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:TabbedViewNavigatorApplication>
my .as file:
package
public class cFields
public function cFields()
what am I doing wrong?
thanksThe <fx:Script source="cBut/cFields.as"> tag will insert your cFields.as file into the MXML file (similar to an include in C/C++). That will cause an invalid syntax, as you've noticed.
Give your package a name (in this case it should be called cBut because that is the name of the folder it is in) then use the import statement inside your script tag. Make sure you adhere to the recommended file, namespace, package and class naming structure. That's usually a reverse-DNS style: com.adobe.utils.bla.bla.bla.
If you package name is blank and the source is in the default folder, you don't need to import it.
Look up the package keyword in the help. -
Package Cannot Be Nested 1037 & Syntax Error 1084
Trying to learn how to crerate a Box2D game in WIndows 8 Flash Pro CC. Opened new document in ActionScript 3.0 Class or ".as" as a Flash Pro application. Very very new to all developer languages and processes. Please help.
package {
import flash.display.Sprite
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class Main extends Sprite{
public function Main(){
trace(*my awsome game starts here *);the default directory is usually in the same directory where the main fla is saved but that can be changed in advanced actionscript settings panel (file>publish settings>actionscript settings - wrench icon).
p.s. you should copy and paste your actualy code. if that is your actual code, that trace is incorrect and should contain a string. ie, change the asterisks to quotes. -
1037: Packages cannot be nested.
Hi
I want to create a package but it is popping me captioned error. I am clueless what is happening.
any help is highly appriciated.
<code>
package scripts.customScripts{
class test{
</code>
thanks in advance.
VarunProvide code snippets where you are declaring packages and
classes.
However as a wild guess you have the package statement on the
timeline of a Flash movie. -
Hi, Am facing issue when I try to run SSIS package via C# code, I have given full access to all the folder in which the package is available.
In the below line am getting error,
using Microsoft.SqlServer.DTS.Runtime;
Application app=new Application();
Package package=null;
package=app.LoadPackage("PackageFullPath",null) --error line
Failed to open package file "C:\SSIS\Package.dtsx" due to error 0x800C0006 "The system
cannot locate the object specified.". This occurs when loading a
package and the file cannot be opened or loaded correctly into the XML documentAre you trying to run this code from job or something? Check if account executing the package has access to the path. Also check if path value passed is correct. If its a remote system path pass it in UNC format (ie //machine/...)
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
Cannot find package error and cannot resolve symbol error
Hi
I have a file Assignment.java in C:\TIJCode\c03 folder. But this file belongs to the default package. This file imports a package com.bruceeckel.simpletest which is in C:\TIJCode\ folder. Now this package has a file named Test.java which accesses a few more files fromt he same package.
I set the classpath to C:\TIJCode. When i try to run the Assignment file I get an error saying package com.bruceeckel.simpletest cannot be found and cannot resolve symbol error. symbol: Test Class: Assignment.
The files in com.bruceeckel.simpletest package were not compiled. So I first tried to do that. But I get a cannot resolve symbol error while trying to compile a file NumOfLinesException which inherits SImpleTestException file. The exact error message is
NumOfLinesException.java : 7 : cannot resolve symbol
symbol : class SimpleTestException
location : class com.bruceeckel.simpletest.NumOfLinesException extends SimpleTestException
The exact code in each of above mentioned files is
//: c03:Assignment.java
// Assignment with objects is a bit tricky.
// From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
import com.bruceeckel.simpletest.*;
class Number {
int i;
public class Assignment {
static Test monitor = new Test();
public static void main(String[] args) {
Number n1 = new Number();
Number n2 = new Number();
n1.i = 9;
n2.i = 47;
System.out.println("1: n1.i: " + n1.i +
", n2.i: " + n2.i);
n1 = n2;
System.out.println("2: n1.i: " + n1.i +
", n2.i: " + n2.i);
n1.i = 27;
System.out.println("3: n1.i: " + n1.i +
", n2.i: " + n2.i);
monitor.expect(new String[] {
"1: n1.i: 9, n2.i: 47",
"2: n1.i: 47, n2.i: 47",
"3: n1.i: 27, n2.i: 27"
} ///:~
//: com:bruceeckel:simpletest:SimpleTestException.java
// From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
package com.bruceeckel.simpletest;
public class SimpleTestException extends RuntimeException {
public SimpleTestException(String msg) {
super(msg);
} ///:~
//: com:bruceeckel:simpletest:NumOfLinesException.java
// From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
package com.bruceeckel.simpletest;
public class NumOfLinesException extends SimpleTestException {
public NumOfLinesException(int exp, int out) {
super("Number of lines of output and "
+ "expected output did not match.\n" +
"expected: <" + exp + ">\n" +
"output: <" + out + "> lines)");
} ///:~
//: com:bruceeckel:simpletest:Test.java
// Simple utility for testing program output. Intercepts
// System.out to print both to the console and a buffer.
// From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
package com.bruceeckel.simpletest;
import java.io.*;
import java.util.*;
import java.util.regex.*;
public class Test {
// Bit-shifted so they can be added together:
public static final int
EXACT = 1 << 0, // Lines must match exactly
AT_LEAST = 1 << 1, // Must be at least these lines
IGNORE_ORDER = 1 << 2, // Ignore line order
WAIT = 1 << 3; // Delay until all lines are output
private String className;
private TestStream testStream;
public Test() {
// Discover the name of the class this
// object was created within:
className =
new Throwable().getStackTrace()[1].getClassName();
testStream = new TestStream(className);
public static List fileToList(String fname) {
ArrayList list = new ArrayList();
try {
BufferedReader in =
new BufferedReader(new FileReader(fname));
try {
String line;
while((line = in.readLine()) != null) {
if(fname.endsWith(".txt"))
list.add(line);
else
list.add(new TestExpression(line));
} finally {
in.close();
} catch (IOException e) {
throw new RuntimeException(e);
return list;
public static List arrayToList(Object[] array) {
List l = new ArrayList();
for(int i = 0; i < array.length; i++) {
if(array[i] instanceof TestExpression) {
TestExpression re = (TestExpression)array;
for(int j = 0; j < re.getNumber(); j++)
l.add(re);
} else {
l.add(new TestExpression(array[i].toString()));
return l;
public void expect(Object[] exp, int flags) {
if((flags & WAIT) != 0)
while(testStream.numOfLines < exp.length) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
List output = fileToList(className + "Output.txt");
if((flags & IGNORE_ORDER) == IGNORE_ORDER)
OutputVerifier.verifyIgnoreOrder(output, exp);
else if((flags & AT_LEAST) == AT_LEAST)
OutputVerifier.verifyAtLeast(output,
arrayToList(exp));
else
OutputVerifier.verify(output, arrayToList(exp));
// Clean up the output file - see c06:Detergent.java
testStream.openOutputFile();
public void expect(Object[] expected) {
expect(expected, EXACT);
public void expect(Object[] expectFirst,
String fname, int flags) {
List expected = fileToList(fname);
for(int i = 0; i < expectFirst.length; i++)
expected.add(i, expectFirst[i]);
expect(expected.toArray(), flags);
public void expect(Object[] expectFirst, String fname) {
expect(expectFirst, fname, EXACT);
public void expect(String fname) {
expect(new Object[] {}, fname, EXACT);
} ///:~What do you have in the C:\TIJCode\ directory? Does the directory structure mimic the package structure for the stuff you're importing?
-
Hi-
Can you please assist me with this error. I have created a dist kit which installs correctly on my PC that has the development environment installed (CVI2012), but fails install on new PC running Win7 (no dev environment installed). The error message is below. Is sometimes will go through the whole installation but never installs it on the PC. Sometimes is will error out right away as in pic below. Can you help? I don't know if this is a Windows problem or an NI problem.
Thanks-
Blue
Solved!
Go to Solution.
Attachments:
dist kit failure.JPG 117 KBThis error also occurs if the install package cannot be accessed properly (network connection, scratched disk, etc.) You could try copying the files directly to the computer to run the install or a new disc if it is scratched).
See example of this issue below for installing LabVIEW from DVD:
http://digital.ni.com/public.nsf/allkb/27BD42F4FDCBD4E7862576DD0057ADA5?OpenDocument
This might help eliminate issues other than the actual installer having an error.
- FCTesting -
AudioElement causes an error in Flex 4
Greetings,
A few days ago Ryan and Brian helped me to patch the problem wtih importing video into Flex by using the 'loadForCompatibility' flag.
This morning I ran into similar problem with audio: the SWF that uses simplest OSMF player plays fine in the Flash CS5 and in the standalone FlashPlayer. Once I import the SWF into Flex 4, even with the SWFLoader flag 'loadForCompatibility' set to 'true', I get this error:
Here is the code for the simplest audio player class (by the way, for some unclear reasons getter/setter didn't work, so for the test case I had to set the variable as 'public' ):
package
import flash.display.Sprite;
import org.osmf.media.MediaPlayer;
import org.osmf.media.URLResource;
import org.osmf.elements.AudioElement;
public class LightAudioElement extends Sprite
public var audioPlayer:MediaPlayer;
public function LightAudioElement(aSource:String)
var resource:URLResource = new URLResource(aSource);
var audioElement:AudioElement = new AudioElement(resource);
audioPlayer = new MediaPlayer();
audioPlayer.media = audioElement;
audioPlayer.autoRewind = true;
And here is the code for the SWF:
import LightAudioElement;
import flash.events.MouseEvent;
var snd:LightAudioElement = new LightAudioElement('assets/Test.mp3');
snd.audioPlayer.autoPlay = false;
//Standard Button component dragged on the stage for this quick test
sndBtn.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(event:MouseEvent):void
if(snd.audioPlayer.playing)
snd.audioPlayer.stop();
else
snd.audioPlayer.play();
Once again, it works fine in both Flash CS5 and standalone FlashPlayer, but produces an error in Flex 4. I'm on OS X 10.6.3, the Flex SDK 4.0
Thanks in advance for any suggestions,
FTQuestHi,
First, and foremost. As Brian Riggs - who is ultimate authority on the subject - has said:
I'd advise against replacing Flex's OSMF.swc with the latest one. The reason is that the Flex SDK integrates with OSMF APIs from a much earlier sprint, and in the latest OSMF SWC many of these APIs don't exist anymore (due to renaming).
And that's what I take seriously.
Yet, out of curiosity, and for the sake of exploration I took my chances and did replace the version of the OSMF that is shipped with the Flex 4.0 release with the latest - 0.95.
So far, all the functionality that I need - single player, multiple players, compiled in Flash, compiled in Flex, playing in synch, or alternating - seems working fine, including access to various events.
Let me repeat: this is NOT a suggestion; just mere sharing of experience, and it comes at a cost - you should use your versions of video player, i.e. built in that latest version of OSMF. The Spark VideoPlayer (or VideoDisplay) give you compile time error I mentioned before - TimeDimension.
Just FYI,
FTQuest -
"cannot open display" error meaning
I'm trying to get dwm running for a while now, and when I try to run it, it says "cannot open display". Then I thought, ok, maybe i have to install an X server, so I got Xorg, installed it, removed dwm and then recompiled it, but I got the same error. Then I thought that maybe I didn't have the right configurations (even though I never bothered config.h or config.mk), so I got gnome (hoping that it would auto-configure itself) so that I can test if it's something with dwm or some other problem with the system. When I tried to start gnome, I got the "cannot open display" error, again (my keyboard will never forgive me for what I did when I saw that).
I went through dwm's wiki more than once, googled the problem, read about Xorg, I just don't know what I'm doing wrong.
Everything was done on a fresh netinstall.
Could you please help me out with this? (Or just link me to somewhere I can find some meaningful information about the problem)
Last edited by imv (2012-04-01 15:02:00)@lifeafter2am I read that, xorg_server and xorg_apps were already installed, since I installed xorg (as in, the whole xorg package). xinit, startx ~/.xinitrc and /etc/X11/xinit/xinitrc , all files/programs mentioned in the wiki, ar missing, though, perhaps it's a hint of some sort
@istbrad212 the video card driver was already installed
Sorry for the slow responses, I have to constantly reboot in order to try everything. -
How to Solve: tag nesting error? in Struts project.
Hello, EveryBody:
I am working for a Struts system in testing a program of look-up user password via user-inputs with birthdate, postal code, userid. I have writen three program, lookup.jsp, LookupForm.java, LookupAction.java. When I get the lookup.jsp run, the web browser displays "HTTP 500". Please find the attached message for error message, lookup.jsp and Lookupform.java. Thanks a lot.
HTTP Status 500 -
type: Exception report
message: description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.compiler.ParseException: End of content reached while more parsing required: tag nesting error?
at org.apache.jasper.compiler.JspReader.popFile(JspReader.java:293)
at org.apache.jasper.compiler.JspReader.hasMoreInput
..........(Omit)
lookup.jsp:
<%@ page language="java" import="com.tfu.struts.common.Constants" %>
<%@ taglib uri="/WEB-INF/app.tld" prefix="app" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:html locale="true">
<head>
<title><bean:message key="lookup.title"/></title>
<html:base/>
</head>
<body bgcolor="#FFFFFF" background="images/FREE-bg.gif">
<%@ include file="header1.html" %>
<html:errors/>
<%
String selectedMonthValue = (String)request.getAttribute(Constants.SELECTED_MONTH_KEY);
log("selectedMonthValue = " + selectedMonthValue);
String selectedCountryValue = (String)request.getAttribute(Constants.SELECTED_COUNTRY_KEY);
log("selectedCountryValue = " + selectedCountryValue);
%>
<html:form action="/lookup">
<html:hidden property="action">
<table>
<tr><td><bean:message key="prompt.lookup.signin"/></td></tr>
<tr><td><bean:message key="prompt.lookup.notes1"/>
<bean:message key="prompt.lookup.notes2"/></td>
</tr>
<tr><td><bean:message key="prompt.lookup.step1"/>
<bean:message key="prompt.lookup.step11"/></td>
</tr>
<tr>
<td><bean:message key="prompt.birthdate"/></td>
<td>
<html:select property="birthmonth" size="1">
<html:options collection="<%= Constants.MONTH_ARRAY_KEY %>"
property="value"
labelProperty="label"/>
</html:select>
<html:text property="birthday" size="2"/>
<bean:message key="prompt.birthdate.comma"/>
<html:text property="birthyear" size="4"/>
<bean:message key="prompt.birthdate.tail"/>
</td></tr>
<tr>
<td><bean:message key="prompt.postcode"/></td>
<td><html:text property="postcode" size="10" maxlength="16"/></td>
<td><bean:message key="prompt.country"/></td>
<td>
<html:select property="country" size="1">
<html:options collection="<%= Constants.COUNTRY_ARRAY_KEY %>"
property="value" labelProperty="label"/>
</html:select>
</td>
</tr>
<tr>
<td>
<bean:message key="prompt.lookup.step2"/>
<bean:message key="prompt.lookup.step21"/>
</td>
</tr>
<tr><td><html:text property="userid" size="16" maxlength="16"/></td></tr>
<tr><td><html:submit property="submit" value="Get Password"/></td></tr>
</table>
</html:form>
<bean:write name="LookupForm" property="password"/>
<br>
<br>
<br>
<br>
<br>
<br>
<%@ include file="footer0.html" %>
</body>
</html:html>
</html>
LookupForm.java
* $Header: /com/tfu/struts/lookup/LookupForm.java
* $Revision: 1.0 $
* $Date: 2002/12/31 $
* writen by Jianming Ke 2002.12.31
package com.tfu.struts.lookup;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import com.tfu.struts.common.Constants;
* Form bean for the user password retrieve.
public final class LookupForm extends ActionForm {
// --------------------------------------------------- Instance Variables
private String birthmonth = null;
private String birthday = null;
private String birthyear = null;
private String postcode = null;
private String country = null;
private String userid = null;
private String password = null;
// ----------------------------------------------------------- Properties
public String getBirthmonth() {
return (this.birthmonth);
public void setBirthmonth(String birthmonth) {
this.birthmonth = birthmonth;
public String getBirthday() {
return (this.birthday);
public void setBirthday(String birthday) {
this.birthday = birthday;
public String getBirthyear() {
return (this.birthyear);
public void setBirthyear(String birthyear) {
this.birthyear = birthyear;
public String getPostcode() {
return (this.postcode);
public void setPostcode(String postcode) {
this.postcode = postcode;
public String getCountry() {
return (this.country);
public void setCountry(String country) {
this.country = country;
public String getUserid() {
return (this.userid);
public void setUserid(String userid) {
this.userid = userid;
public String getPassword() {
return (this.password);
public void setPassword(String password) {
this.password = password;
// --------------------------------------------------------- Public Methods
* Validate the properties that have been set from this HTTP request,
* and return an <code>ActionErrors</code> object that encapsulates any
* validation errors that have been found. If no errors are found, return
* <code>null</code> or an <code>ActionErrors</code> object with no
* recorded error messages.
* @param mapping The mapping used to select this instance
* @param request The servlet request we are processing
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if ((postcode == null) || (postcode.length() < 1))
errors.add("postcode", new ActionError("error.postcode.required"));
if ((userid == null) || (userid.length() < 1))
errors.add("userid", new ActionError("error.userId.required"));
return errors;
I edited the struts-config.xml with two segments:
<!-- ========== Form Bean Definitions ================== -->
<form-beans>
<!-- Logon form bean -->
<form-bean name="logonForm"
type="com.tfu.struts.logon.LogonForm">
</form-bean>
<!-- Lookup form bean -->
<form-bean name="lookupForm"
type="com.tfu.struts.lookup.LookupForm">
</form-bean>
<!-- ========== Action Mapping Definitions ================= -->
<action-mappings>
<!-- Lookup a user password -->
<action path="/lookup"
type="com.tfu.struts.lookup.LookupAction"
name="lookupForm"
scope="request"
input="/lookup.jsp">
<forward name="lookpass" path="/logon.jsp"/>
</action>Hi,
After I added the line you mentioned, new error messages displays...
javax.servlet.ServletException: No getter method for property action of bean org.apache.struts.taglib.html.BEAN
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
at org.apache.jsp.lookup$jsp._jspService(lookup$jsp.java:719)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
Thanks a lot.
Maybe you are looking for
-
Returning only records that have no entry in a specific field
Hello, I'm new to this forum and relatively new to Crystal Reports, so I apologize if this information is "plain as day" somewhere. I've been hunting for this info for quite a while and can't find anything that makes sense! I am trying to put togeth
-
Printing to a HP Color Laserjet CM4540 MFP from new iPad.
I am trying to print from my new iPad to my HP Color Laserjet CM4540 MFP. When I try to print the iPad gives me the option to choose my printer. It currently only recognizes one printer- not the CM4540. It recognized the other printer without any pro
-
In Windows 7 my latest ITunes version won't let the 'autohide' feature work for my task bar. I have mine set at the bottom of all pages, and they all work when the Itunes page is up. But not the ITunes home page itself. The task bar is gone, and w
-
Help! How to retrive the date and time from MySQL 'datetime' type
In my MySQL database, I have stored a data type 'DATETIME' as 20070412093012 which is interpreted as 2007-04-12 09:30:12, How to using Java method to retrive it from data base??? like resultSet.getDate('datetime')????or what is the method?
-
Error when downloading music to DVD
I am downloading my playlists to DVD to make space on my computer. When doing so I am finding that when I go to play a song from the DVD some tracks are missing. They are still showing up but have an exclamation mark by it. When I click on it I get t