java - Refresh a Servlet by another Servlet -
i have create little webshop school-project, entered in problem during process updating/refreshing servlets.
description: created index.html file includes 2 servlets via iframes, left side navigation-servlet , on right controller-servlet show welcome page (or shows off categories etc.) - works fine.
but have implement login small administration. clicking in navigation on administration, leads servlet called administration-servlet, in right iframe (actually not on controller-servlet).
there comes login mask, user put in username , password. if login correct, leads administration content (not finished now).
the upcoming problem somehow have update/refresh navigation iframe too, when login successful because there must logout-button , entries have hidden.
by "technique" or pattern can solve problem? maybe little code example helpful. :)
best greets.
instead of using iframes put different parts of site, use dynamic include in servlets. allow build response page server side , therefore dynamically change included in page. when log in send authentication request servlet dynamically construct new response multiple jsp files.
<jsp:include page="..." /> another solution use scripting language apache velocity template scripts build responses dynamically. allowing include or exclude information depending on parameters or session context.
Comments
Post a Comment