Case Description:
Page A: http: /localhost: 8080/Houser/newsmanage. Action? Categoryname = 402880f5122bc83801122bd89fae0005
Page B: newsmanage. FTL
Write on the FTL page as follows:
$ {Req. getparameter ("categoryname ")}
But what if you want to use the <# If command to make $ {Req. getparameter ("categoryname")} participate in the comparison? Note the following:
Correct writing:
1)
<# List pagesdatas as ls>
<# If ls. newscategory. ID? Default ("") = '$ {Req. getparameter ("categoryname")}'>
.....................
</# If>
</# List>
2)
<# List pagesdatas as ls>
<# If ls. newscategory. ID? Default ("") = "$ {Req. getparameter ('categoryname')}">
.....................
</# If>
</# List>
3
<# List pagesdatas as ls>
<# If ls. newscategory. ID? Default ("") = "$ {Req. getparameter (\" categoryname \ ")}">
.....................
</# If>
</# List>
Incorrect syntax:
<# List pagesdatas as ls>
<# If ls. newscategory. ID? Default ("") = "$ {Req. getparameter (" categoryname ")}">
.....................
</# If>
</# List>
Cause: it should be four double quotation marks that conflict with each other.
Supplement: Correct syntax for assigning $ {Req. getparameter ("categoryname")} to the variable:
1) <# assign Var = "$ {Req. getparameter ('categoryname')}">
2) <# assign Var = '$ {Req. getparameter ('categoryname')}'>
3) <# assign Var = "$ {Req. getparameter (\" categoryname \ ")}">