モバイル版 Web アプリケーションを開発するための準備として、jQuery Mobile ベースの実験アプリケーションを作成し、問題点を洗い出す。
対象は、Web ブラウザ上で動作してシステムのクライアント側となる部分 (HTML, CSS, JavaScript) のみとし、サーバー側は範囲外とする。
<body> | |
<script> | |
function popupNonBlock() { | |
var win = window.open("", "child", "width=400, height=300"); | |
win.document.body.innerHTML = "loading..."; | |
location.href = 'opener.html'; | |
} | |
</script> | |
<a href="opener.html">block</a> |
モバイル版 Web アプリケーションを開発するための準備として、jQuery Mobile ベースの実験アプリケーションを作成し、問題点を洗い出す。
対象は、Web ブラウザ上で動作してシステムのクライアント側となる部分 (HTML, CSS, JavaScript) のみとし、サーバー側は範囲外とする。
mail.pop3.host=localhost | |
mail.debug=false |
public class UUIDBase64URLSafeTest { | |
String toBase64Url(UUID uuid) { | |
return toBase64Url(uuid.getMostSignificantBits()) | |
+ toBase64Url(uuid.getLeastSignificantBits()); | |
} | |
String toBase64Url(long src) { | |
byte[] binaryData = toBinaryData(src); | |
return Base64.encodeBase64URLSafeString(binaryData); |
import javax.servlet.http.HttpSession; | |
public class HttpSessionStub implements HttpSession { | |
private final Map<String, Object> attributes = new HashMap<String, Object>(); | |
@Override | |
public Object getAttribute(String name) { | |
return attributes.get(name); | |
} | |
@Override |
import org.apache.commons.fileupload.FileItem; | |
public class FileUploadStub { | |
class FormFileStub extends FileItemStub { | |
private final String fileName; | |
private final byte[] fileData; | |
public FormFileStub(String fieldName, String fileName, byte[] fileData) { | |
super(fieldName); | |
this.fileName = fileName; | |
this.fileData = fileData.clone(); |
public static void createDummyFile(String name, int length) throws IOException { | |
RandomAccessFile file = new RandomAccessFile(name, "rw"); | |
file.setLength(length); | |
file.close(); | |
} | |
@Test | |
public void testCreateDummyFile() throws IOException { | |
File file = new File("work/DummyFile"); | |
file.delete(); |
import org.apache.commons.lang3.ObjectUtils; | |
private <E extends Cloneable> List<E> copyDeep(List<? extends E> src) { | |
List<E> dest = new ArrayList<E>(); | |
for (E item : src) { | |
dest.add(ObjectUtils.clone(item)); | |
} | |
return dest; | |
} | |
@Test |
import org.apache.commons.lang3.StringUtils; | |
private String stripStartZero(String source) { | |
return StringUtils.stripStart(source, "0"); | |
} | |
@Test | |
public void testLeftZeroTrim() { | |
assertEquals("1", stripStartZero("001")); | |
assertEquals("23", stripStartZero("023")); | |
assertEquals("4", stripStartZero("4")); |
<html> | |
<head> | |
<style type="text/css"> | |
table.nospace { | |
border-collapse: collapse; | |
} | |
table.nospace th, table.nospace td { | |
padding: 0; | |
} | |
</style> |