開発メモ

開発用のメモです。

2014-04-23から1日間の記事一覧

Session 新規/未作成時を制限する Interceptor

import javax.servlet.http.HttpSession; import org.apache.struts2.ServletActionContext; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.interceptor.AbstractInterc…

HTTPメソッドをPOSTのみに制限するInterceptor

import org.apache.commons.lang3.StringUtils; import org.apache.struts2.ServletActionContext; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.interceptor.Abstract…

maven-build.xml の作り方

mvn ant:ant

Seasar2 + Struts2 の pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelVersion>4.0.0</modelVersion> <groupId>webapp</groupid></project>

ワイルドカードを用いたアクション

sruts.xml <constant name="struts.mapper.alwaysSelectFullNamespace" value="false" /> <constant name="struts.enable.SlashesInActionNames" value="true" /> java @Actions({ @Action(value = "edit/*", params = { "id", "{1}" }), }) public String edit() { logger().info("edit/id : " + id); return INPUT; }</constant></constant>

Error bad ELF interpreter: No such file or directory の対処

# java -v -bash: /usr/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory yum -y install lib/ld-linux.so.2

起動スクリプト

Web

/etc/init.d/httpd #!/bin/sh # # /etc/rc.d/init.d/httpd # # Control the httpd # # chkconfig: 345 44 56 # description: apache httpd # ctrl=/usr/local/apache2/bin/apachectl command=$1 # Source function library. . /etc/init.d/functions exec_ht…

configure オプション

Web

ダウンロード wget http://archive.apache.org/dist/httpd/httpd-2.4.9.tar.bz2 wget http://archive.apache.org/dist/apr/apr-1.5.1.tar.bz2 wget http://archive.apache.org/dist/apr/apr-util-1.5.3.tar.bz2 解凍 tar -zxf httpd/httpd-2.4.9.tar.bz2 tar…

configure オプション

PHP

./configure \ --with-apxs2=/usr/local/apache2/bin/apxs \ --enable-mod-charset \ --enable-libgcc \ --enable-mbstring \ --enable-embedded-mysqli \ --enable-zip \ --enable-mysqlnd \ --with-mysql

Twitter: @asahina_alice