Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
git test
Jpress
Commits
bbf64a6a
Commit
bbf64a6a
authored
6 years ago
by
fuhai999@gmail.com
Browse files
Options
Download
Email Patches
Plain Diff
v2.0-rc.9
parent
2f5d81de
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
jpress-core/src/main/java/io/jpress/web/directive/CheckedIfDirective.java
+6
-9
...main/java/io/jpress/web/directive/CheckedIfDirective.java
jpress-core/src/main/java/io/jpress/web/directive/MaxLengthDirective.java
+1
-1
...main/java/io/jpress/web/directive/MaxLengthDirective.java
jpress-core/src/main/java/io/jpress/web/directive/SelectedIfDirective.java
+6
-9
...ain/java/io/jpress/web/directive/SelectedIfDirective.java
with
13 additions
and
19 deletions
+13
-19
jpress-core/src/main/java/io/jpress/web/directive/CheckedIfDirective.java
+
6
-
9
View file @
bbf64a6a
...
...
@@ -16,14 +16,11 @@
package
io.jpress.web.directive
;
import
com.jfinal.template.Env
;
import
com.jfinal.template.TemplateException
;
import
com.jfinal.template.io.Writer
;
import
com.jfinal.template.stat.Scope
;
import
io.jboot.web.directive.annotation.JFinalDirective
;
import
io.jboot.web.directive.base.JbootDirectiveBase
;
import
java.io.IOException
;
/**
* @author Michael Yang 杨福海 (fuhai999@gmail.com)
* @version V1.0
...
...
@@ -32,17 +29,17 @@ import java.io.IOException;
@JFinalDirective
(
"checkedIf"
)
public
class
CheckedIfDirective
extends
JbootDirectiveBase
{
@Override
public
void
onRender
(
Env
env
,
Scope
scope
,
Writer
writer
)
{
Object
param
=
getPara
(
0
,
scope
);
if
(
"true"
.
equalsIgnoreCase
(
String
.
valueOf
(
param
)))
{
try
{
writer
.
write
(
"checked"
);
}
catch
(
IOException
e
)
{
throw
new
TemplateException
(
e
.
getMessage
(),
location
,
e
);
if
(
param
instanceof
Boolean
)
{
if
((
Boolean
)
param
)
{
renderText
(
writer
,
"checked"
);
}
}
else
if
(
"true"
.
equalsIgnoreCase
(
String
.
valueOf
(
param
)))
{
renderText
(
writer
,
"checked"
);
}
}
}
This diff is collapsed.
Click to expand it.
jpress-core/src/main/java/io/jpress/web/directive/MaxLengthDirective.java
+
1
-
1
View file @
bbf64a6a
...
...
@@ -43,7 +43,7 @@ public class MaxLengthDirective extends JbootDirectiveBase {
int
maxLength
=
getPara
(
1
,
scope
,
0
);
if
(
maxLength
<=
0
)
{
throw
new
IllegalArgumentException
(
"#maxLength(content,length) 参数错误,length必须大于0 "
);
throw
new
IllegalArgumentException
(
"#maxLength(content,length) 参数错误,length必须大于0 "
+
getLocation
()
);
}
String
suffix
=
getPara
(
2
,
scope
);
...
...
This diff is collapsed.
Click to expand it.
jpress-core/src/main/java/io/jpress/web/directive/SelectedIfDirective.java
+
6
-
9
View file @
bbf64a6a
...
...
@@ -16,14 +16,11 @@
package
io.jpress.web.directive
;
import
com.jfinal.template.Env
;
import
com.jfinal.template.TemplateException
;
import
com.jfinal.template.io.Writer
;
import
com.jfinal.template.stat.Scope
;
import
io.jboot.web.directive.annotation.JFinalDirective
;
import
io.jboot.web.directive.base.JbootDirectiveBase
;
import
java.io.IOException
;
/**
* @author Michael Yang 杨福海 (fuhai999@gmail.com)
* @version V1.0
...
...
@@ -36,14 +33,14 @@ public class SelectedIfDirective extends JbootDirectiveBase {
@Override
public
void
onRender
(
Env
env
,
Scope
scope
,
Writer
writer
)
{
Object
param
=
getPara
(
0
,
scope
);
if
(
"true"
.
equalsIgnoreCase
(
String
.
valueOf
(
param
)))
{
try
{
writer
.
write
(
"selected"
);
}
catch
(
IOException
e
)
{
throw
new
TemplateException
(
e
.
getMessage
(),
location
,
e
);
if
(
param
instanceof
Boolean
)
{
if
((
Boolean
)
param
)
{
renderText
(
writer
,
"selected"
);
}
}
else
if
(
"true"
.
equalsIgnoreCase
(
String
.
valueOf
(
param
)))
{
renderText
(
writer
,
"selected"
);
}
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment