Struts registration, landing, email instance analysis

xiaoxiao2021-03-06  77

First, Web.xml

1.

Action

org.apache.struts.Action.ActionServlet

config

/web-inf/struts-config.xml ,/web-inf/struts-config-registration.xml

1

2.

/web-inf/app.tld

/web-inf/app.tld

Second, Struts-Config.xml

Type = "org.apache.struts.validator.dynavalidatorform">

2.

3.

..................

..................

4.

Local or Global "Forward" Rather Than A Module-Relative Path ->

5.

6.

Property = "Pathnames" Value = "/ Web-inf / validator-rules.xml,

/Web-inf/Validation.xml "/>

Third, struts-config-registration.xml

Define the relevant operations of the registration:

1. Form-bean: RegistrationForm

2. Global-Forwards:

3. Action-mapings:

TYPE = "ZWD_10.EDITREGISTRATIONATIONACTION"

Attribute = "registrationform"

Scope = "request"

Validate = "false">

TYPE = "ZWD_10.SAveRegistrationAction"

Name = "registrationform"

Scope = "request"

Input = "registration" /> 4, Java file content

Constants: // constant class

Public Final Class Constants {

Public static final string package = "zwd_10";

Public static final string database_key = "database";

Public static final string subscription_key = "subscription";

Public static factory string user_key = "user";

2. User: // Interface

Public interface user {

Public userDatabase getDatabase ();

Public string getFromaddress ();

Public void setfromaddress (String fromaddress);

Public string getFullName ();

Public void setfullname (String Fullname);

Public string getpassword ();

Public void setPassword (String Password);

Public string getreplytoaddress ();

Public void setReplyToaddress (String replytoAddress);

PUBLIC SUBSCRIPTION [] GetSubscriptions ();

Public String getUsername ();

Public Subscription CreateSubscription (String Host);

Public Subscription FindSubscription (String Host);

Public void RemoveSubscription (Subscription Subscription);

MemoryUser: // Implement the USER interface

3. UserDatabase: // Interface

Public interface userdatabase {

Public user createuser (String UserName);

Public void close () throws Exception;

Public user finduser (String username)

Public user [] findusers ();

Public void open () throws exception;

Public Void Removeuser (User User);

Public void save () throws exception;

MemoryUserDatabase: // Implement MemoryUserDatabase interface

4. Subscription: // Interface

Public interface subscription {

Public Boolean getautoconnect ();

Public void setAutoconnect (Boolean AutoConnect);

Public String gethost ();

Public string getpassword ();

Public void setPassword (String Password);

Public String gettype (); public void settype;

Public user getuser ();

Public String getUsername ();

Public void setusername (String Username);

MemorySubscription: // Implement MemoryUserDatabase interface

5. MemoryDatabasePlugin: // Implement the PLUGIN interface, which is described in Struts-Config.xml

5. App.TLD (Custom Label)

1. Statement Checklogontag ---- Corresponding Checklogontag.java

Checklogontag: // Extends Tagsupport interface

2. Declaration LinksubscriptionTAG ---- Corresponding to LinkSubscriptionTAG.JAVA

LinkSubscriptionTAG: // Extends Tagsupport interface

3. Declaration LinkUsertag ---- Corresponding to LinkUsertag.java

LinkUsertag: // Extends Tagsupport interface

Sixth, registration part

Seven, Logon section

Eight, logoff part

Nine, Subscription section

The above content is my own understanding, please also ask all criticism to correct, thank you.

转载请注明原文地址:https://www.9cbs.com/read-121456.html

New Post(0)