File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# ActFramework Change Log
22
33##1 .8.33**
4+ * wrong file object inject from form field into the controller param #1316
45* API doc - URL path variable in POST endpoint info is incorrect #1284
56* ` SampleData.ProvidedBy ` is not effective on int type field #1310
67
Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ private ISObject _store(FileItemStream fileItemStream) throws IOException {
8989 retVal = getFull (key );
9090 } else {
9191 int size = output .written ;
92+ if (0 == size ) {
93+ return null ;
94+ }
9295 byte [] buf = output .buf ();
9396 retVal = SObject .of (key , buf , size );
9497 }
Original file line number Diff line number Diff line change 1+ package test ;
2+
3+ import org .beetl .core .Context ;
4+ import org .beetl .core .Function ;
5+ import org .osgl .util .S ;
6+
7+ import javax .inject .Named ;
8+
9+ @ Named ("myFunc" )
10+ public class BeetlTestFunction implements Function {
11+
12+ @ Override
13+ public Object call (Object [] objects , Context context ) {
14+ String value = (String ) objects [0 ];
15+ String ovalue = (String ) objects [1 ];
16+ if (S .eq (value , ovalue , S .IGNORECASE )){
17+ return "checked" ;
18+ }
19+ return "" ;
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ < html >
2+ < head > Test</ head >
3+ < body >
4+ < div >
5+ Test result1: < span id ="r1 "> ${myFunc()}</ span >
6+ </ div >
7+ < div >
8+ Test result2: < span id ="r2 "> ${myFunc()}</ span >
9+ </ div >
10+ </ body >
11+ </ html >
Original file line number Diff line number Diff line change 1212 <parent >
1313 <groupId >org.actframework</groupId >
1414 <artifactId >act-starter-parent</artifactId >
15- <version >1.8.31 .0</version >
15+ <version >1.8.32 .0</version >
1616 </parent >
1717
1818 <properties >
2525 <dependency >
2626 <groupId >org.actframework</groupId >
2727 <artifactId >act</artifactId >
28- <version >1.8.32 -SNAPSHOT</version >
28+ <version >1.8.33 -SNAPSHOT</version >
2929 </dependency >
3030 <dependency >
3131 <groupId >org.actframework</groupId >
Original file line number Diff line number Diff line change 1+ package ghissues ;
2+
3+ import act .controller .annotation .UrlContext ;
4+ import act .util .PropertySpec ;
5+ import org .osgl .mvc .annotation .GetAction ;
6+ import org .osgl .mvc .annotation .PostAction ;
7+ import org .osgl .util .N ;
8+ import org .osgl .util .S ;
9+
10+ import java .io .File ;
11+
12+ import static act .controller .Controller .Util .renderTemplate ;
13+
14+ @ UrlContext ("1316" )
15+ public class Gh1316 extends BaseController {
16+
17+ @ GetAction
18+ public void form () {
19+ renderTemplate ("/1316.html" );
20+ }
21+
22+ @ PostAction ()
23+ public String filetest (File [] files1 , File [] files2 ) {
24+ if (files1 .length == 0 && files2 .length == 0 ) {
25+ return null ;
26+ }
27+ return "found" ;
28+ }
29+
30+ }
Original file line number Diff line number Diff line change 1+ < html >
2+ < head >
3+ < title > GH1316 form</ title >
4+ </ head >
5+ < body >
6+ < form action ="/1316 " method ="post " enctype ="multipart/form-data ">
7+
8+ < input name ="files1 " type ="file " multiple />
9+ < input name ="files2 " type ="file " multiple />
10+
11+ < button type ="submit "> Submit</ button >
12+ </ form >
13+ </ body >
14+ </ html >
Original file line number Diff line number Diff line change 1+ Scenario(1316) :
2+ description : " wrong file object inject from form field into the controller param"
3+ interactions :
4+ - description : test
5+ request :
6+ post : 1316
7+ response :
8+ status : 404
You can’t perform that action at this time.
0 commit comments