除了特定问题的异步/同步特性,并考虑到MOM(在这种情况下选择了JMS)提供免费的额外功能,如负载平衡和其他功能,在选择JMS而不是REST时还可以考虑其他什么,反之亦然?
谢谢
有人能告诉我我做错了什么吗?我需要在一段时间后刷新页面,但它刷新到页面顶部,我需要它不改变页面位置!所以这就是我现在没有工作的是meta标签吗?这是我没有仍然不刷新必须做错的事情?
这是我原来的......
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="refresh" content="72">
<meta http-equiv="Pragma" CONTENT="no-cache">
<meta http-equiv="Expires" CONTENT="-1">
<style type="text/css">
body
{
background-image: url('../Images/Black-BackGround.gif');
background-repeat: repeat;
}
</style>
</head>
<script type="text/javascript">
function saveScrollPositions(theForm) {
if(theForm) {
var scrolly = typeof window.pageYOffset != 'undefined' ? window.pageYOffset
: document.documentElement.scrollTop;
var scrollx = typeof window.pageXOffset != 'undefined' ? window.pageXOffset
: document.documentElement.scrollLeft;
theForm.scrollx.value = scrollx;
theForm.scrolly.value = scrolly;
}
}
</script>
<form action="enroll.php" name="enrollment" method="post" onsubmit="return saveScrollPositions (this);">
<input type="hidden" name="scrollx" id="scrollx" …Run Code Online (Sandbox Code Playgroud) 我想将Web服务URL请求表示为对象,并发现有许多常见参数可以在继承层次结构中"冒泡".一个请求可能有很多参数,一些是必需的,另一些是可选的,我相信Bloch的Builder模式是一个很好的选择,用一个流畅的接口模拟命名参数.
具体来说,我正在设计Google Maps Web服务API,它具有一般的Web服务请求
http://maps.googleapis.com/maps/api/service/output?{parameters}
Run Code Online (Sandbox Code Playgroud)
service并且output是必需参数和sensor必需参数.还有一个可选参数language.
每个服务都有一组强制和可选参数.地理编码服务有两个可选参数,bounds和region.它还具有互斥的强制参数,address或者location指定服务类型(分别为直接或反向地理编码).我用新的儿童班来代表这种互斥.
我想象类层次结构如下:
.-----.
| Url |
'-----'
^
|
.---------.
| Request |
'---------'
^
|----------------------------+--------------...
.---------. .------------.
| Geocode | | Directions |
'---------' '------------'
^ ^
|------------+ .
.--------. .---------. .
| Direct | | Reverse | .
'--------' '---------'
Run Code Online (Sandbox Code Playgroud)
然后,我想做类似以下的事情:
String output = "xml";
boolean sensor = true;
String address = "Av. Paulista, São Paulo, Brasil"; …Run Code Online (Sandbox Code Playgroud) 我想知道应用程序的安装路径在哪里.我知道它通常在...\Program Files ...但我猜有些人在不同的地方安装它.我知道应用程序的名称.
谢谢.
虽然我做了一些广泛的搜索,但我遇到了一些代码并且无法理解它的某个方面!
我的问题是:为什么有时在括号中声明类,如下面的代码?
public class Animal {
public static void hide() {
System.out.println("The hide method in Animal.");
}
public void override() {
System.out.println("The override method in Animal.");
}
}
public class Cat extends Animal {
public static void hide() {
System.out.println("The hide method in Cat.");
}
public void override() {
System.out.println("The override method in Cat.");
}
public static void main(String[] args) {
Cat myCat = new Cat();
Animal myAnimal = (Animal)myCat;
myAnimal.hide();
myAnimal.override();
}
}
Run Code Online (Sandbox Code Playgroud)
我的重点是这一行代码:
Animal myAnimal = (Animal)myCat;
Run Code Online (Sandbox Code Playgroud)
我认为这与一个类扩展另一个类但不确定括号中定义的类表示什么的事实有关. …
我想测试这个函数的返回值getFileExtension(input.files [0] .name)(我有一个注释指向那一行)我的问题是如何在javascript中打印出该值?谢谢!
<script>
function getFileExtension(filename) {
var ext=filename.split('.').pop();
return ext
}
</script>
<input type='file' onchange="readURL(this);">
<script>
function readURL(input) {
if (input.files && input.files[0]) {
if (getFileExtension(input.files[0].name)=="png") { // this line is our problem
var reader = new FileReader();
reader.onload = function (e) {
document.getElementById("pdf").innerHTML="<img id='blah' src=" +
e.target.result + " alt='your image' width='450'>"
}
reader.readAsDataURL(input.files[0]);
}
}
}
</script>
Run Code Online (Sandbox Code Playgroud) 我可以在C中创建一个可以在用户模式下随时访问的文件吗?
我的意思是
zwcreatefile(...shareread||sharewrite...)
Run Code Online (Sandbox Code Playgroud)
我可以在用户模式下使用fopen吗?
我希望我的日志文件可以共享读写,所以当我的程序运行时,我仍然可以打开它并查看日志,而我的程序仍然写在那里.
我试图采用缩短的URL并在java中以字符串格式将其扩展为其原始的全长URL.我已经能够在线追踪一个教程,但是我无法让它真正得到我的完整网址.有没有人以前做过这个或者知道怎么做?任何帮助都是巨大的,谢谢
URLConnection conn = null;
try {
URL inputURL = new URL("http://bit.ly/9mglq8");
conn = inputURL.openConnection();
} catch (MalformedURLException e) {
} catch (IOException ioe) {
}
String realU = conn.toString();
Toast.makeText(ImagetestActivity.this, realU,
Toast.LENGTH_LONG).show();
Run Code Online (Sandbox Code Playgroud) 我想知道如何使用方括号 {} [] () 和其他类似“'”的特殊字符部分添加到我在下面尝试的唯一字符中,但是由于某种原因,当我添加另一个这些字符时,它停止工作.
<-- works but does not have any brackets or quotes for special character-->
<form acton = "#">
<input type="password" id="newPass" required
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*?[0-9])(?=.*?[!@#$%^&*+`~=?\|<>/]).{8,}"
<button>submit</button>
</form>
Run Code Online (Sandbox Code Playgroud)
上面的部分有效但没有引号或更多特殊字符
下面的代码有括号但不起作用
<-- does not work (if you do not enter special character user will be able to submit but it does not have any brackets -->
<form acton = "#">
<input type="password" id="newPass" required
pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*?[0-9])(?=.*?[~`!@#$%^&*()-_=+[]{};:'.,"\|/?><]).{8,}"
<button>submit</button>
</form>
Run Code Online (Sandbox Code Playgroud)
这也不起作用(来自答案)
<form acton = "#">
<input type="password" id="pass" required
pattern="(?=.*\d)(?=.*[a-z])(?=.*?[0-9])(?=.*?[~`!@#$%\^&*()\-_=+\[\]{};:\'.,\"\\|/?\>\<]).{4,}">
<button>submit</button>
</form>
Run Code Online (Sandbox Code Playgroud)
我正在寻找使底部(带括号和我包含的所有特殊字符的部分)起作用的答案。
我正在努力让我的第一个ajax示例在我的MAMP上工作.我的ajax.html看起来像:
<html>
<head>
<script src='ajax.js'></script>
</head>
<body onload = 'ajax()'>
<div id='test'></div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我的ajax.js看起来像:
function ajax()
{
>>var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","http://localhost:8888/ajax.php",true);
xmlhttp.send();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("test").innerHTML=xmlhttp.responseText;
}
}
}
我的ajax.php看起来像:
回声"你好世界";
我从firebug中检测到响应头:
响应标头
连接保持活动
内容长度11
内容类型文本/ html
日期星期一,2012年11月5日18:57:46 GMT
保持活动超时= 5,最大= 99
服务器Apache/2.2.22(Unix)mod_ssl/2.2 .22 OpenSSL/0.9.8r DAV/2 PHP/5.4.4
X-Pad避免浏览器错误
X-Powered-By PHP/5.4.4
但没有任何回复文本,我的HTML没有任何改变.
有人可以帮帮我吗?
谢谢!
javascript ×4
java ×3
html ×2
windows ×2
ajax ×1
asynchronous ×1
builder ×1
c ×1
c# ×1
css ×1
file ×1
fopen ×1
installation ×1
integration ×1
jms ×1
path ×1
php ×1
rest ×1
synchronous ×1
url ×1