Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Struts2 study notes -Valuestack (value stack) and OGNL expression     - Multi-core CPU, multi-threading and parallel computation (Linux)

- CentOS 6.x and CentOS7 installation RPMforge (Linux)

- Teach you how to synchronize Microsoft OneDrive in Linux (Linux)

- Ubuntu 14.10 / Linux Mint 17.1 Win10 compiler install rdesktop 1.8.3 Remote Desktop connection (Linux)

- Linux system components Detailed log (Linux)

- Laravel configuration PhpStorm + Xdebug + Chrome settings Debug Environment (Server)

- Ubuntu 14.04 and derivative version of the user on how to install cURL 7.37.1 (Linux)

- Deploy the project to the server from GitHub (Server)

- Linux character device - user mode and kernel mode data transfer data (Linux)

- Linux development management utility command (Linux)

- MySQL query plan key_len know all (Database)

- rpm package specify the installation path (Linux)

- About Git (Linux)

- Use MySQL optimization of security to prevent misuse of aliases (Database)

- Source encountered problems and solutions when installing SaltStack (Server)

- LNMP summary of the issues common 502 Bad Gateway (Server)

- ctop: monitor container performance Linux command line artifact (Linux)

- FFmpeg compiled with only H264 decoding library (Programming)

- How do you turn on and off IPv6 address on Fedora (Linux)

- To install Xen in Ubuntu 12.04 (Linux)

 
         
  Struts2 study notes -Valuestack (value stack) and OGNL expression
     
  Add Date : 2017-08-31      
         
         
         
  Just my Struts2 study notes on Value Stack (value stack) and OGNL expression, will speak what I know, I want to be useful.

First, the value of the stack effect

Data recording process action of the current request.

Second, small example

Two action: Action1 and Action2
Action1 has two attributes: name and passwd
Action2 has two properties: name2 and passwd2
Request comes from Action1, chain guide Action2 method
Struts.xml configuration information:

< ? Xml version = "1.0" encoding = "UTF-8"?>

< ! DOCTYPE struts PUBLIC
        "- // Apache Software Foundation // DTD Struts Configuration 2.3 // EN"
        "Http://struts.apache.org/dtds/struts-2.3.dtd">

< Struts>
    < Package name = "default" namespace = "/" extends = "struts-default">
        < Action name = "action1" class = "com.geekgao.action.Action1">
            < Result type = "chain">
                < Param name = "actionName"> action2 < / param>
            < / Result>
        < / Action>

        < Action name = "action2" class = "com.geekgao.action.Action2">
            < Result>
                /welcome.jsp
            < / Result>
        < / Action>
    < / Package>
< / Struts>
welcome.xml:

< % @ Taglib prefix = "s" uri = "/ struts-tags"%>
< % -
  To change this template use File | Settings | File Templates.
-%>
< % @ Page contentType = "text / html; charset = UTF-8" language = "java"%>
< Html>
< Head>
    < Title> < / title>
< / Head>
< Body>
    name: < s: property value = "name" /> < br>
    passwd: < s: property value = "passwd" /> < br>
    locale: < s: property value = "locale" />
    < S: debug> < / s: debug>
< / Body>
< / Html>
Third, access

Access path: http: // localhost: 8080 / Struts2OGNL / action1 name = nn & passwd = pp?
Struts2OGNL project name

Note that we are connected to the values are already present in the value of the stack, and that name and passwd. And we found that this is obviously a stack, who should call whom below, the value of the time when we are beginning the search down from the top of the stack, the value is the final result of the first found.

jsp in value approach:

name: < s: property value = "name" /> < br>
passwd: < s: property value = "passwd" /> < br>
locale: < s: property value = "locale" />
According to the name value, value is OGNL expression, that object graph navigation language, is based on this expression to find an object.
If there is a property of an object class, such as User user, User name and passwd property there, so you can pass parameters:
http: // localhost:? 8080 / Struts2OGNL / action1 user.name = nn & user.passwd = pp
And the value can be:

name: < s: property value = "user.name" /> < br>
passwd: < s: property value = ". user passwd" /> < br>
locale: < s: property value = "locale" />
Of course, you can also call the direct use of object methods, for example, the following code:

< S: property value = "user.toString ()" />
     
         
         
         
  More:      
 
- Solaris 11 forget the root password (Linux)
- Development environment to build MEAN In Ubuntu 15.10 (Server)
- How to install and use the Snort in Ubuntu 15.04 (Linux)
- Neo4j map data processing tab (Database)
- Tomcat itself through simple movement separation (Server)
- Why you can have JavaScript string method (Programming)
- Java collections series (Programming)
- Drawing from the Android source code analysis View (Programming)
- MySQL Parameter Tuning Best Practices (Database)
- DDOS Attacks and Prevention (Linux)
- Linux configuration Samba server (Server)
- C language binary tree counts words (Programming)
- Oracle SDE and maintain common commands - Display space (Database)
- Scope of variables in Object-C (Programming)
- 17 How to install the Ubuntu 14.04 and Linux Mint Kodi14 (XBMC) (Linux)
- The Linux kernel and AVL tree in red-black tree (Programming)
- MongoDB upgrade to 2.6 (Database)
- Linux / Raspberry Pi using the following command-line based web browser (Linux)
- Composition and dynamic memory allocation C program (Programming)
- DupeGuru- find and remove duplicate files (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.