<p>How would I assign a variable within scriplet code in JSP &lt;%>  and then use struts logic tags to do stuff based on the value of the variable assigned in the scriplet code block?</p>

<p>I have tried using struts:logic equal and greaterthan to no avail....</p>

<p>Many Thanks,</p>

What you are trying to do (if I understand you correct) is basically this:
```
```
<% String foo = "Test"; %>
<bean:write name="foo" />
```
```
Which, as you already know, doesn't work. That would give an error like this:
Cannot find bean foo in any scope
What I usually do, is to put my data in the page scope like this:
```
```
<% pageContext.setAttribute("foo", "Test"); %>
<bean:write name="foo" />
```
```
(This is for Struts 1.1. Newer versions may provide a better way to do it.)