我正在使用 <detail:form>并<tags:field >在我的jsp页面中.我试图查看浏览器使用firebug生成的源代码,它向我显示表单名称为" checkForm ",所有字段名称都有"check".作为前缀.因此,该字段之一(它是一个单选按钮)名称是check.isEndorseByApplicant.
我想要实现的是,当选择下拉菜单中的某个元素时,我想将单选按钮从yes更改为no.问题是因为该字段在其名称中包含点,我不能这样做.即document.checkForm.check.isEndorseByApplicant不适合我.我现在无法从该字段的名称中取出点.有任何想法吗?
function autoSelect(checkEndorsement)
{
alert(document.checkForm.check.isEndorseByApplicant)
if(checkEndorsement.value=="Student")
check.isEndorsedBy[0].checked=true;
else
check.isEndorsedBy[1].checked=true;
}
</html:javascript>
Run Code Online (Sandbox Code Playgroud)
...
<detail:form object="check" >
Run Code Online (Sandbox Code Playgroud)
....
<td><tags:field property="isEndorseByApplicant" onclick="autoSelect(this.form);" /></td>
Run Code Online (Sandbox Code Playgroud) 我使用V1以获得来自Microsoft REST API的令牌.(我们有Office 365租户,我曾经成功获得所有资源,但没有任何问题.
clientId =8a67......de4b6
clientSecret =J58k8....5EU=
redirectUri =http://example.com...
resourceUrl =https://graph.microsoft.com
authority = https://login.microsoftonline.com/f02633....a603/oauth2/token
Run Code Online (Sandbox Code Playgroud)
https://login.microsoftonline.com/f0263...0be3/oauth2/authorize?client_id=8a6..b6&redirect_uri=http://example.com&response_type=code&scope=mail.read
它给了我一个在JWT上结构如下的令牌.它表示无效签名但不确定是什么问题.
一旦我有了令牌,我就尝试了下面的卷曲调用
curl -i https://graph.microsoft.com/v1.0/me/messages -H 'Content-Type: application/x-www-form-urlencoded' -H 'Authorization: Barer eyJ.[TOKEN]...UNa6nfw'
Run Code Online (Sandbox Code Playgroud)
而不是消息,我收到以下错误:
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8Cl23
Server: Microsoft-IIS/8.5
request-id: af2390b1-a9b...5ab9
client-request-id: af2390,....a615ab9
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West US","Slice":"SliceA","ScaleUnit":"000","Host":"AGSFE_IN_4","ADSiteName":"WST"}}
X-Powered-By: ASP.NET
Date: Thu, 19 Jan 2017 23:55:43 GMT
Content-Length: 268
{
"error": {
"code": "InvalidAuthenticationToken",
"message": "CompactToken parsing failed with error code: -2147184105",
"innerError": {
"request-id": "af2390b1-...5ab9",
"date": "2017-01-19T23:55:44"
}
} …Run Code Online (Sandbox Code Playgroud) 我有 Java OOP 背景并了解接口。
目前正在开发一个简单的预算应用程序(https://github.com/compound-developers/compound-supply-examples),该应用程序将 ETH 或稳定币放入Compound 中并赚取利息。
我的困惑是如何使用 Solidity 接口。我有 OOP (Java) 背景,非常熟悉接口。
所以在这段代码( )中你可以看到界面中MyContracts.sol有一个函数。mint()但是,它没有实现,但您可以看到这里使用它而uint mintResult = cToken.mint(_numTokensToSupply);没有任何实现。
任何人都可以在没有实现的情况下如何使用接口函数吗?在这种情况下,当您调用mint时,实际上正在执行哪些代码?
我有这门课
@Entity
@Table(name = "DB.APPL_SESSION")
@AttributeOverrides({@AttributeOverride(name = "id", column = @Column(name = "APPL_SESSION_ID"))})
@SequenceGenerator(name = "TableSequence", sequenceName = "DB.APPL_SESSION_SQ")
public class AiSession{
@Formula("(select sum(nvl(budg.AMT_OV,budg.AMT)) from DB.BUDGET budg where budg.APPL_SESSION_ID = APPL_SESSION_ID)")
private LocalDate realSessionStartDate;
Run Code Online (Sandbox Code Playgroud)
在上面的公式中,我使用DB.BUDGET对象和当前对象id(APPL_SESSION_ID).但现在我只想使用AidApplicantYearSession类中的下一个成员变量(StartDate)
@Basic
@Temporal(TemporalType.DATE)
@Column(name = "START_OV_DT")
private Date overrideStartDate;
Run Code Online (Sandbox Code Playgroud)
我应该如何编写一个看起来像上面的公式,但只使用对象的成员变量?我想出来了
@Formula("(select START_OV_DT from DB.APPL_SESSION)")
Run Code Online (Sandbox Code Playgroud)
这是正确的方法吗?这两个公式的逻辑完全不同.
我有以下响应,应该来自MailChimp webhook URL.
这是行BODY:
RAW BODY
type=usub&fired_at=2015-07-23+17%3A19%3A34&data%5Baction%5D=unsub&data%5Breason%5D=manual&data%5Bid%5D=9383uy636&data%5Bemail%5D=youremail%40YOURDOMAIN.com&data%5Bemail_type%5D=html&data%5Bip_opt%5D=202.9.3.003&data%5Bweb_id%5D=404004&data%5Bmerges%5D%5BEMAIL%5D=YOUREMAIL%40YOURDOMAIN.com&data%5Bmerges%5D%5BFNAME%5D=NAME&data%5Bmerges%5D%5BLNAME%5D=LASTNAME&data%5Blist_id%5D=2288883
FORM/POST PARAMETERS
fired_at: 2015-07-22 12:19:34
data[email]: YOUREMAIL@DOMAINNAME.com
data[id]: 56775409ta
data[web_id]: 09833944
data[merges][EMAIL]: YOUREMAIL@DOMAINNAME.com
type: unsub
data[list_id]: 99884hy372
data[merges][FNAME]: Name
data[ip_opt]: 202.0.9.3333
data[reason]: manual
data[email_type]: html
data[action]: unsub
data[merges][LNAME]: LastName
**QUERYSTRING key: a4483983hu473004884j0x**
HEADERS
Accept: */*
Total-Route-Time: 0
Host: requestb.in
Connection: close
Content-Length: 395
User-Agent: MailChimp.com
Connect-Time: 0
Via: 1.1 vegur
X-Request-Id: 6633d8-653e-4cea-884j-9933ju4773h
Content-Type: application/x-www-form-urlencoded
Run Code Online (Sandbox Code Playgroud)
我@RequestParameter之前在使用Spring Controllers时曾经使用过,但是我不知道如何从上面的响应中获取数据,例如data [merges] [FNAME]:
我怎样才能在Spring控制器中获取QueryString?QUERYSTRING键:a4483983hu473004884j0x
//I have the following code to …Run Code Online (Sandbox Code Playgroud) 我们最近开始使用SonarQube.我们已经找到了SonarQube建议的一些规则,但我们想忽略它们或给它们低优先级,甚至配置SonarQube建议的时间.例如
我们希望避免使用规则(和/或配置SonarQube建议的优先级和时间)
我找不到一种方法来配置这个规则被忽略.我们希望忽略整个项目而不是特定类的这种规则.
配置此值将有助于我们更好地估算时间,以解决主要问题并为上述规则提供低优先级.我们正在使用SonarQube 6
我建议你.
我有后端Spring经验,但是我没有在Web容器(例如Tomcat)上部署应用程序的丰富经验。我能够使用Eclipse STS工具运行Spring Batch Admin。然而,随着后这个我莫名其妙地被混淆关于如何从Spring Batch的管理用户界面创建自己的春天批处理应用程序,并在Tomcat上部署它们,并进行管理。
在IntelliJ上创建的Spring Batch项目中,我根本找不到任何war文件。我也阅读了上面的文档,它使您了解到这一点,以便您可以下载war文件。但是所有文件都是jar文件。我有点困惑,关于如何创建Spring Batch作业以及如何在Spring Batch Admin上部署它们的逐步指南会很棒。我很感激。
我需要进行以下POST调用.但是,即使我提供了正确的客户端ID和密码ID,我的电话也会被拒绝.
curl POST https://login.microsoftonline.com/f02....e3/oauth2/token
-H 'Content-Type: application/x-www-form-urlencoded' --data 'grant_type=authorization_code&redirect_uri=https://requestb.in/ac&
source=https://graph.microsoft.com&client_id=1e1....-913d9
&client_secret=YmbSFYz.....4Uk=&scope=mail.read&code=AaAAA........on0a569'
Run Code Online (Sandbox Code Playgroud)
这是我收到的错误:
curl: (6) Could not resolve host: POST
{"error":"invalid_client","error_description":"AADSTS70002:
Error validating credentials. AADSTS50012: Invalid client secret is
provided.\r\nTrace ID: 78d...a2b\r\nCorrelation ID:
01....ab2\r\nTimestamp: 2016-12-14 01:46:47Z","error_codes":[70002,50012],"timestamp":"2016-12-14 01:46:47Z","trace_id":"78d....a2b","correlation_id":"018.....ab2"}
Run Code Online (Sandbox Code Playgroud)
我怎么能解决这个问题?
编辑:我正在尝试在本文档中实现第二部分(即获取令牌)
我花了几个星期试图弄清楚我应该为我发布的这个问题带来什么样的解决方案.由于我找不到Shiro-Grails集成的完整文档,我正在寻找一些其他框架(如Spring)来保护我们基于Web的轻量级Web应用程序.
该应用程序已有几个月的历史,并不是一个巨大的应用程序.不超过20个持久类.但是,我相信它会很快成长.但是,安全性还没有实现,我想确保我会找到最好的安全框架(对我来说最好的可能包括:免费源代码,文档齐全,易于与Grails集成,可扩展,最后但更不安全更安全).
有什么建议?
我正在使用Spring MVC 2.5.
我有字段,数字应该只是put中允许的.我在我正在寻找的UI上收到确切的错误消息.就像是
Failed to convert property value of type [java.lang.String] to required type [java.math.BigDecimal] for property executionThresholdAmount; nested exception is java.lang.NumberFormatException
Run Code Online (Sandbox Code Playgroud)
我不想向用户显示这种消息.我使用message.properties文件来组织要显示的文本.
我唯一需要的是我想覆盖特定字段的错误消息.我不能这样做,但这是我正在使用的技巧
if(result.hasFieldErrors()){
List<FieldError> bindingErrors=( List<FieldError>)result.getFieldErrors();
BindingResult fieldErrors=new BeanPropertyBindingResult (offerSetting, "offerSetting");
for(FieldError error :bindingErrors ){
String field=error.getField();
fieldErrors.rejectValue(field, "invalid.amount."+field);
}
result=fieldErrors;
#more code
Run Code Online (Sandbox Code Playgroud)
我正在做的是我创建了BeanPropertyBindingResult,它是BindingResult的一个实现,并使用我想要的消息填充错误字段,并将引用传递给结果对象,以便显示它.但是,我现在收到两个默认消息
like
Failed to convert property value of type [java.lang.String] to required type [java.math.BigDecimal] for property executionThresholdAmount; nested exception is java.lang.NumberFormatException
Run Code Online (Sandbox Code Playgroud)
还有我想要的信息.就像是
"The amount for field price you entered is invalid"
Run Code Online (Sandbox Code Playgroud)
有更好的想法吗?
java ×3
spring ×2
spring-mvc ×2
azure ×1
curl ×1
data-binding ×1
ethereum ×1
forms ×1
formula ×1
grails ×1
hibernate ×1
html ×1
interface ×1
javascript ×1
mailchimp ×1
office365api ×1
orm ×1
radio-button ×1
rules ×1
security ×1
solidity ×1
sonar-runner ×1
sonarqube ×1
spring-batch ×1
stripes ×1
war ×1