2. For the quadratic equation in $x$
$$
m^{2} x^{2}+(2 m+3) x+1=0
$$

there are two real roots whose product is 1; for the quadratic equation in $x$
$$
x^{2}+(2 a+m) x+2 a+1-m^{2}=0
$$

there is a real root that is greater than 0 and less than 4. Then the integer value of $a$ is . $\qquad$
2, -1.
According to the problem, we have $m^{2}=1, m= \pm 1$, and
$$
\Delta=(2 m+3)^{2}-4 m^{2}=12 m+9>0 \text {. }
$$

Thus, $m=1$.
Let $f(x)=x^{2}+(2 a+1) x+2 a$, then we should have
$$
f(0) f(4)=2 a(20+10 a)<0,
$$

which means $a(a+2)<0$.
Therefore, $-2<a<0$. Hence, $a=-1$.