GithubHelp home page GithubHelp logo

HDIV parameter does not exist about hdiv HOT 11 OPEN

saranyaz avatar saranyaz commented on July 17, 2024
HDIV parameter does not exist

from hdiv.

Comments (11)

gillarramendi avatar gillarramendi commented on July 17, 2024

Hi,
your hdiv-config.xml file is not correctly formatted. You can't have more tan one <hdiv:config>element in the same file.

Please have a look at this example application and configuration file:

from hdiv.

saranyaz avatar saranyaz commented on July 17, 2024

Hi

I updated my config file now. I encounter the same error still.. Can kindly help to say where I am going wrong ?

hdiv-config.txt

<Jul 7, 2017 11:24:18 PM SGT> <Notice> <Stdout> <BEA-000000> <[DEBUG][2017-07-07 23:24:18,437][][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kern el.Default (self-tuning)'][][](org.hdiv.filter.ValidatorHelperRequest) - Error restoring the state: Valid: false, Errorcode: ValidatorError [type=HDI V_PARAMETER_DOES_NOT_EXIST, target=/abc/index.do, parameterName=_HDIV_STATE_, parameterValue=null, originalParameterValue=null, localIp=null, remoteI p=null, userName=null, validationRuleName=null]> <Jul 7, 2017 11:24:18 PM SGT> <Notice> <Stdout> <BEA-000000> <[INFO ][2017-07-07 23:24:18,437][][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kern el.Default (self-tuning)'][][](org.hdiv.logs.Logger) - HDIV_PARAMETER_DOES_NOT_EXIST;/abc/def/index.do;_HDIV_STATE_;;;127.0.0.1;127.0.0.1;anonymous;>

update:
after adding the startpages as /abc/index.do, I can load my application page. But for each ".do" page I am getting similar error as mentioned above, which leads to HDIV unauthorized error page.

from hdiv.

anderruiz avatar anderruiz commented on July 17, 2024

Ok, we need some clarifications on this. You should set as StartPage every single page that can be accessed directly, usually / but there may be others. For the rest of them
you should be navigating using the links provided by the application. In those links if Hdiv integration is correct you should be seeing something like this:

/efm/whatever.do?HDIV_STATE=1-3-AABBCC..

I guess that your current problem is that no link is being generated with that parameter right?. If not please could you explain your situation?

from hdiv.

saranyaz avatar saranyaz commented on July 17, 2024

Thanks for the response.
/efm/whatever.do?HDIV_STATE=1-3-AABBCC..
=> I don't see anything like this in my console and also in my logs.
all I see is as below with no random ID as you mentioned above.

HDIV_PARAMETER_DOES_NOT_EXIST;/abc/def/.do;HDIV_STATE;;;127.0.0.1;127.0.0.1;anonymous;>

My application's each menu link or buttons is initiated by a .do. so how do I config this ? looks like I need to all do. as start page which is not the correct way to implement. right ?
My application using struts 1.2.9.

The tld files are taken from the hdiv-master\hdiv-struts-1\target\classes\META-INF\ and I replaced it in my application tld file location /WEB-INF/tld/ and mapped it correctly in the web.xml file.

from hdiv.

gillarramendi avatar gillarramendi commented on July 17, 2024

Hi,
you should see this kind of url in the HTML of your application: /efm/whatever.do?HDIV_STATE=1-3-AABBCC..
If Hdiv is configured correctly all links and forms contain an HDIV_STATE parameter in links and an extra hidden field in forms.
An important aspect to take into consideration is that you have to create the links and form using Struts tags.
Por example, <html:link> for links and <html:form> for forms.
This is the way Hdiv adds the HDIV_STATE parameter automatically.

Are you creating the links and forms using these tags?

from hdiv.

saranyaz avatar saranyaz commented on July 17, 2024

Thanks for your reply

Yes, all the forms are using html:form struts tag. But still the HDIV parameter token is not generated. I am not sure where I am going wrong. I am still figuring it out !

from hdiv.

gillarramendi avatar gillarramendi commented on July 17, 2024

Ok, the forms are created using Struts tags, and what about the links? Are they created using <html:link>tags?

from hdiv.

saranyaz avatar saranyaz commented on July 17, 2024

My application do not have html:links tags. All of the actions are triggered by context path .do file.

Struts token are inserted automatically as a hidden field in all JSP if I use saveToken() whereas I face issue with the token to be inserted with HDIV. jar

from hdiv.

gillarramendi avatar gillarramendi commented on July 17, 2024

Ok, if you are interested in link protection you have to use <html:link> tag. Otherwise you will get HDIV_PARAMETER_DOES_NOT_EXIST error.

If you are not interested in link protection you have to exclude GET request protection.
Add this line inside <hdiv:config> tag in the hdiv-config.xml file:

<hdiv:startPages method="get">/.*</hdiv:startPages>

Including this config you will skip the protection of all requests that use method GET.
POST request protection is still enabled with this configuration.

Another important question, which Hdiv version are you using?
We recommend to use last stable version 3.3.0, which is compatible with Struts 1.3.8

from hdiv.

saranyaz avatar saranyaz commented on July 17, 2024

ok, after I change the start pages as suggested above. I get the below error

org.hdiv.filter.ResponseWrapper) - New ResponseWrapper instance. [DEBUG][2017-07-19 10:46:00,630][][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'][][](org.hdiv.session.SessionHDIV) - Getting page with id:00000000-0000-0000-0000-000000000018 [DEBUG][2017-07-19 10:46:00,630][][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'][][](org.hdiv.filter.ValidatorHelperRequest) - Validation Error Detected: Parameter [org.apache.struts.taglib.html.TOKEN] does not exist in the state for action [/def/home.do] [INFO ][2017-07-19 10:46:00,630][][[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'][][](org.hdiv.logs.Logger) - INVALID_PARAMETER_NAME;/abc/def/home.do;org.apache.struts.taglib.html.TOKEN;;;192.168.91.1;192.168.91.1;anonymous;

I use the version 3.3.2.

ok. to use the 3.3.0 I download the codes for hdiv-config and hdiv-struts-1 from this link and compile it as a jar file https://github.com/hdiv/hdiv. is this the correct link ?

update:

after I include the below in hdiv config file

<hdiv:startParameters>org.apache.struts.action.TOKEN,org.apache.struts.taglib.html.TOKEN</hdiv:startParam

I get the same error as before

org.hdiv.filter.ResponseWrapper) - New ResponseWrapper instance. [DEBUG][2017-07-19 11:03:56,686][][[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'][][](org.hdiv.filter.ValidatorHelperRequest) - Error restoring the state: Valid: false, Errorcode: ValidatorError [type=HDIV_PARAMETER_DOES_NOT_EXIST, target=/def/ghiIndex.do, parameterName=_HDIV_STATE_, parameterValue=null, originalParameterValue=null, localIp=null, remoteIp=null, userName=null, validationRuleName=null] [INFO ][2017-07-19 11:03:56,686][][[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'][][](org.hdiv.logs.Logger) - HDIV_PARAMETER_DOES_NOT_EXIST;/abc/def/ghiIndex.do;_HDIV_STATE_;;;192.168.91.1;192.168.91.1;anonymous;

I can load my login page, I choose the role to login and click submit, I get the error as above.. (post action)

from hdiv.

gillarramendi avatar gillarramendi commented on July 17, 2024

Hi,
Hdiv 3.3.0 jars are publicly available at the central Maven repository.
You can download them from this web too: http://search.maven.org/#artifactdetails%7Corg.hdiv%7Chdiv-core%7C3.3.0%7Cjar

It seems Hdiv Taglibs are not executing and the application is invoking Struts original tags instead.

You can check it adding a breakpoint at this method:

org.hdiv.taglib.html.FormTagHDIV.addHDIVParameter()

If should stop every time a form is rendered. If it is not invoked, the Tld is not correctly configured.

To check if the Hdiv taglib installation is correct, review this points:

from hdiv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.