Can anyone help me to convert the following PHP example into JSP? I know that I need to use out.print("something") but I'm unclear how I can incorporate my variable names prior to the variable values themselves.
Here is the PHP code:
Here is my JSP conversion so far. I am not clear on how I mimic the variable name prior to the variable value itself.Code:$result = "OK"; $update = "1"; $updateid = "90094"; echo "result=".$result."\n"; echo "update=".$update."\n"; echo "updateid=".$updateid."\n";
Another question would be, given that I've already used EL to declare the variables above, it seems like I am creating more work than is necessary. Would it be possible and how then would I replicate the PHP echo usingCode:<c:set var="result">OK</c:set> <c:set var="update">0</c:set> <c:set var="updateid">NULL</c:set> <% // Respond to the application with 1) result, 2) update, and 3) updateid values String result = "OK"; String update= "0"; String updateid= "NULL"; out.print("result=" + result); out.print("update=" + update); out.print("updateid=" + updateid); %> <p>You have the current version, version <c:out value="${versionmaj}"/>.<c:out value="${versionmin}"/>.<c:out value="${versionbld}"/> </p>Would this work for that:Code:<c:out value="${somevalue}"/>
Code:<c:out value="somevalue=" + ${somevalue} />


Reply With Quote
ut> but I would rather like to append the variables to their associated 'result=', 'update=', and 'updateid=' descriptors.
Bookmarks